We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    The login isn't logged with that line, even if that's the only line in the plugin.

    What other events are there for the manager user getting logged out? For example, with sessions getting flushed?
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      This is what I've really been hating about trying to work with Revo ever since the beginning. Trying to trace some function or another. I can go trace the Flush Sessions menu item as far as connectors/security/flush.php and there I find
      <?php
      require_once dirname(dirname(__FILE__)).'/index.php';
      $modx->request->handleRequest(array('location' => 'security','action' => 'flush'));

      What does that mean? Where does code execution go from there? Searching files for "flush" I find core/model/modx/processors/security/flush.class.php that defines the modSecurityFlushProcessor class with a few functions (no triggering of the OnManagerLogout event there), but can't find any other reference to the modSecurityFlushProcessor class. How does MODx get from the connector to the processor?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 3749
        • 24,544 Posts
        Well, there's OnBeforeManagerLogout and OnBeforeWebLogout. I don't think flushing sessions fires any System Event but I could be wrong.

          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          So it goes from the connector to the processor?

          Click menu item -> connector -> processor? And that code in the connector tells handleRequest which processor - i.e. processors/security/flush.class.php?
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 3749
            • 24,544 Posts
            That's pretty much it. That particular menu item has inline JS code that pops up the "Are you sure" dialog. When you confirm, the JS sends the Ajax request to the connector:

            MODx.msg.confirm({
                title: _('flush_sessions')
                ,text: _('flush_sessions_confirm')
                ,url: MODx.config.connectors_url+'security/flush.php'
                ,params: {
                    action: 'flush'
                }


            The flush.php connector sends the action on to the request handler:

            $modx->request->handleRequest(array('location' => 'security','action' => 'flush'));



            The request handler loads the processor (processors/security/flush.class.php) and calls its process() method, where the actual flushing occurs.

            As far as I can tell, nobody along the line invokes any events.

              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Ok. One more place where doing much the same thing behaves differently when done from different links or buttons. I can see why it can't, though, because all it does is truncate the session database. It would have to make an array of all logged-in users, then process each one individually.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 12066
                • 48 Posts
                Was looking for the same thing and came across this:
                A little bit easier and less line consuming.

                $modx->logManagerAction($action, $class_key, $item)