We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4095
    • 372 Posts
    I have searched the forums and can’t find the solution to my problem. I am trying to use WebSignup 1.1 with MODx 0.9.5 RC2, and I want to use Captcha to reduce the number of Bots registering.

    GD 2.0.x is installed and Captcha does works for the Manager login if I enable it, so its all there.

    The page is uncached (tried cached as well) and is called via [[WebSignup? &useCaptcha=`1` &groups=`Registered Users`]], I also tried using [! !].

    However it doesn’t show Captcha yet I can still register which implies its been forced to off. Any suggestions?
      [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
      Admin Sandbox Login: sandbox Password: castle
      • 10746
      • 126 Posts
      Well, I am not the author nor an authority, but my experiments suggest that this is a BUG.

      If you look in websignup.inc.php then the function "getWebSignuptpl()" creates the form, and inside this function there is a line

      <?php if ($useCaptcha) { ?>


      Trouble is that $useCaptcha is NOT SET inside the function, even if it is correctly set at that point where the function is called - to verify that this is the problem, just put the lines

      if (!isset($useCaptcha)) {
        print "Hey, useCaptcha not set here":
      }


      immediately after the line "function getWebSignuptpl()" on line 164 and see what appears on your screen.



      I managed to "fix" it by making the function take a parameter

      function getWebSignuptpl($useCaptcha)


      and then CALLING it with the appropriate value where it is called (line 9)

      if (!$tpl) $tpl = getWebSignuptpl($useCaptcha);



      <WARNING>
      This makes the captcha appear and is a "proof of concept" but it is not a bugfix because I have no idea how the rest of the code is structured and simply randomly altering functions to meet one’s immediate needs is not a proper bug resolution technique. Use at your own risk
      </WARNING>

      I suggest emailing the author...

      Hope this helps..

      Gordon