Topic-icon New User Redirect

Active Subscriptions:

None
11 years 5 months ago #50207 by lyljov
New User Redirect was created by lyljov
Hi Alex,

I'm aware of the New User Redirect from the back end settings. However, do you think you could point me where or which part of the code JFB does this? Because what we're planning to do is to have this conditional filter depending on which page the user is clicking on "register with fb."

e.g. for commenting, we want them to log in right there but never leave that page so that they could conveniently right their comment/review (native) which is contrary to our regular registration that redirects them to their profiles for them to edit.

Thanks!
The topic has been locked.
Support Specialist
11 years 5 months ago #50215 by mel
Replied by mel on topic New User Redirect
Lyle,

Start by looking at /component/com_jfbconnect/models/loginregister.php. Around line 121 is the method called getLoginRedirect which attempts to figure out where to redirect after the login. That code is called from two different methods - the login method in /component/com_jfbconnect/controllers/login.php and the createNewUser method in /component/com_jfbconnect/controllers/loginregister.php.

Let us know if you have any questions, but it should be pretty straightforward to do what you're looking for with just updating that one method.

-Melissa
The topic has been locked.
Active Subscriptions:

None
11 years 5 months ago #50232 by lyljov
Replied by lyljov on topic New User Redirect
Hi Mel,

Thanks for the response. So, what you're suggesting is, we localize the function on the code we're getting and just change the following line:

$redirect = JFactory::getApplication()->getUserState('com_jfbconnect.login.return', 'index.php');

to a redirection link of a different kind (in our case, we want it to redirect to the same link, or publish the action based on the "review" provided). What would be the correct syntax for this?
The topic has been locked.
Support Specialist
11 years 5 months ago #50233 by mel
Replied by mel on topic New User Redirect
You're probably also going to have to alter the entire function to make sure the first two if statements aren't going to get executed first before you perform your check for where the user was authenticating from. As always, there are many different ways to implement this, but this is the section you need to focus on.
The topic has been locked.