Forward to dashboard after registration

As the title describes. ive looked into the actions/registration.php but only see the FORWARD HTTP_REFERER option affecting the actions, it cant be as simple as changing the site URL correct? lol

  • You would to remove the gatekeeper() from the start.php of the riverdashboard mod and forward to /pg/dashboard on the actions/register.php file.

     

    Untested code:

    on /actions/register.php replace the line no. 64 with

    forward(pg/dashboard);

     

     

     

     

     

  • alrighty, so it forwards to the dashboard on login but only if already logged in as a differrent user, registering the other aswell but, if logged out, the page states on an elgg echo "you must be logged in to view that page"

    So, my deduction is that we need a short action string to execute something like follows, in succession on the submission of the registration variables (button clicked; "register" with all fields filled) ***$logout-cookied-user, register$ -> $login(username,password) -> forward('pg/dashboard');***

     

    (sidenote, how would i set the page to redirect to the dashboard instead of the index if theu ser is already logged in?")


    void pcntl_exec ( string $path [, array $args [, array $envs ]] )

    seems to be headed in the right direction, just how wouldi change the syntac to make it work with this situation? php noob here :P but im learning ^_^

  • I think you can do that in mod/your_theme/views/index.php

     

    if (isloggedin()) {

    forward('pg/dashboard/');

    }

  • im using a customized xuum mod, I dont think the handle is available in that index, couldnt find it in a search of the code, but after insterting it there was no result.

  • You could use the LoginRedirector plugin:

    http://community.elgg.org/pg/plugins/project/384766/developer/jdalsem/loginredirector

    It allows to redirect users to dashboard, profile or a custom page. It can also be configured for a different redirect on the first login after registration. If the plugin is not 100% what you need, I'm sure you can take its code as a starting point at least.

  • Find the action file (most likely seems to be register)

    where the forward is at the bottom change to the following:

    if(isloggedin()){

    forward($vars['url'] . "pg/dashboard");

    }else{

    forward($vars['url']);

    }

    If you look at Shouvik's post you will also find another answer. Go to root/mod/riverdashboard/index.php

    at the top there should be the following:

    gatekeeper();

    if so, remove it. Then non-loggedin users can view the dashboard.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking