× Joomla Facebook Connect support forum

Topic-icon Disable New User Redirection

Active Subscriptions:

None
12 years 9 months ago #11434 by fb_634042543
In my site, I embedded some Facebook login buttons in the article. I would like to keep the new user at the same page after registration.

I would like to disable all "New User Redirection:" for JFBCLogin. I find a setting "New User Redirection:", but no choice for disable it....
Could Alex give me a quick hack or tell me which lines concerning the new users redirection.

Thanks a lot=]

PS: I do suggest that a new choice: "Enable New User Redirection" should be made.
Also, the "New User Redirection" should be set at module parameter, giving more flexibility to us=]
The topic has been locked.
Support Specialist
12 years 9 months ago #11451 by alzander
Anson,
We have a task to add that as an option, but I think in about 6 months, you're the 2nd to ask for it.. so it's not the highest priority thing for us. However, making this change should be very easy. In the /components/com_jfbconnect/controllers/loginregister.php file, search for "function login()". At the end of that section, there's a big block of if statements with references to redirects. You can comment out the first few lines here, and it should do what you're looking for. However, if you have returning user redirection enabled, you may need some other minor changes (which we can help with if this doesn't work). Mainly, make this section look like:
//if ($jfbcLibrary->initialRegistration)
        //{
        //    $redirectId = $configModel->getSetting('facebook_new_user_redirect', 'index.php');
        //    $redirect = JRoute::_("index.php?Itemid=" . $redirectId, false);
        //}
        //else
        if ($configModel->getSetting('facebook_login_redirect_enable') && !$jfbcLibrary->initialRegistration)
        {
            $redirectId = $configModel->getSetting('facebook_login_redirect', 'index.php');
The // are comments, so the first if, which redirects new users, simply won't execute.

Hope that helps, but again, if not, just let us know!
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 9 months ago #11499 by fb_634042543
work perfectly, thanks for your quick support=]
The topic has been locked.
Support Specialist
12 years 9 months ago #11509 by alzander
No problem, glad we could help, and as always, if you need something else.. let us know. Again, we'll likely add this option into a near-future release as it shouldn't be hard and is asked about here and there. Until then, if you upgrade, and the option isn't there yet, the code should be about the same as above.

Thanks,
Alex
The topic has been locked.