Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

building registration page into front page

I have managed to build the registration page into my front page when users are not signed in:

$UserID = $this->Request->Get('userid', Gdn::Session()->UserID);

if ($UserID == 0 ) {
    include(CombinePaths(array(PATH_LIBRARY, 'vendors/recaptcha', 'functions.recaptchalib.php')));
 echo "<div id=\"Content\">\n";

    echo "</div>\n";

It looks good :-)
But doesn't actually function :-(

I'm sure there is a much better way to achieve this that actually works.
Illumination will be much appreciated.

Best Answer


  • x00x00 MVP
    Answer ✓

    It won't work becuase it is cargo cult

    grep is your friend.

  • x00 said:
    It won't work becuase it is cargo cult

    Okay I accept I don't fully understand how this system works.

    And you have a solution?

  • x00x00 MVP
    edited May 2012

    basically you need to reproduce the controller method code (Register), you don't need to do the post back stuff, instead you will point through the form target to the entry controller and the. It would be an idea to modularise it.

    Another way is to load it through the api and javascript. This is probably the simplest for you.


    grep is your friend.

  • reproduce the controller method code

    I assume by this you don't mean reproducing the relevant content of registercaptcha.php within default.master.php.

    So is this utilising the code from function RegisterCaptcha() in a new class to be called under the appropriate conditions?


    class FrontEndEntryController extends Gdn_Controller {
       private function FrontEndRegisterCaptcha() {
Sign In or Register to comment.