We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    This may be unimportant (or not), but it has me scratching my head big time.

    I tried to create another plugin like the Captcha plugin.

    I duplicated the Captcha plugin (Captcha is disabled but installed so it’s executing, but not doing anything).

    In my new plugin, I boiled things down to just setting the event _output to "
    Hello world" for the onManagerLoginFormRender and to true for onBeforeManagerLogin.

    I got the weird login screen with just the two input boxes and nothing else.

    I tried deleting the new plugin and just duplicating the Captcha plugin.

    With Captcha turned on, in theory, that should just show the captcha challenge twice. Instead, I got the two boxes again.

    It looks like the Captcha plugin is doing something that prevents other login plugins from working, even when Captcha is turned off. I can’t see anything wrong with it. And it works fine when it’s the only plugin listening to those events.

    I strongly suspect that my original new plugin would have worked if I had uninstalled the Captcha plugin.

    I’m wondering if there’s something wrong (or just tricky) with the event model when two plugins are responding to the same event. If not, there’s probably something seriously wrong with the Captcha plugin, though I can’t see what it might be.
      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
      • 22303 MODX Staff
      • 10,725 Posts
      Are we talking about Evo or Revo here BobRay?
        • 3749
        • 24,544 Posts
        Quote from: OpenGeek at Sep 06, 2009, 11:12 AM

        Are we talking about Evo or Revo here BobRay?

        Sorry, Revo.
          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
          • 22303 MODX Staff
          • 10,725 Posts
          Can you send me or point me to the code for both plugins so I can test this and see what’s going on?
            • 3749
            • 24,544 Posts
            Quote from: OpenGeek at Sep 07, 2009, 01:39 PM

            Can you send me or point me to the code for both plugins so I can test this and see what’s going on?

            You can get the Captcha plugin at the WTF.

            After installing, just duplicate the plugin with a new name.

            In theory, that should just show the CAPTCHA challenge twice on the login page. Instead, it trashes the login page (check in another browser wink ), showing the two input boxes, but no prompts and no CAPTCHA images.

            I deleted the other plugin in order to log in, but it was basically like this (listening to the same system events as the CAPTCHA plugin):
            <?php
            switch ($modx->event->name) {
                case 'OnBeforeManagerLogin': /* authenticate  */
                    $rt = true;
                    $modx->event->_output = $rt;
                    break;
            
                case 'OnManagerLoginFormRender': /* Ouput Prompt */
                    $rt = '<hr />Testing';
                 
                    $modx->event->_output = $rt;
                    break;
            }
            ?>
              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