Topic-icon Login Redirect not working

Active Subscriptions:

None
12 years 10 months ago #10443 by decksys
I'm using the JFBCLogin module for user login to my site. In Basic Options it is set to redirect on Joomla login and on the line below it is set to redirect to a member menu/page viewable for "registered" users. But no one is redirected to that page but just keep standing on the same page. If I change the redirect page to a menu/page that have "public" access level then it works. But the idea for login is to get access to "registered" levels and pages and of course the redirect need to work for that - i guess. Is there any setup anywhere else I need to check or is this an error? Thanks.
The topic has been locked.
Support Specialist
12 years 10 months ago #10445 by alzander
Replied by alzander on topic Login Redirect not working
Not sure, we'll have to look into it a little further to understand why a registered page may not work. Can you let me know a few more things, just to make sure I have a good understanding of your configuration:
1) The redirect you're talking about is strictly for users logging in with Joomla accounts.. not using the Login With Facebook button, correct?
1a) If so, is the Login With Facebook process working as you'd expect?
2) Do you have the "Automatically Login Facebook Users" setting enabled? If so, please try disabling it and testing.

Beyond that, if you could, please post (or Private Message) a link to the front-end of your site. We can take a look at the HTML and see if we can determine where the redirect is trying to go, and figure out if that's right or not, which will help us narrow things down.

Thanks!
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 10 months ago #10454 by ozidoggy
Replied by ozidoggy on topic Login Redirect not working
I also have this issue.. I want the login to redirect to a menu item for registered users only.. However it will not redirect to the page if the menu item is for registered users.
The topic has been locked.
Active Subscriptions:

None
12 years 10 months ago #10467 by decksys
Replied by decksys on topic Login Redirect not working

alzander wrote: 1) The redirect you're talking about is strictly for users logging in with Joomla accounts.. not using the Login With Facebook button, correct?
1a) If so, is the Login With Facebook process working as you'd expect?
2) Do you have the "Automatically Login Facebook Users" setting enabled? If so, please try disabling it and testing.


Re 1) No. It's both logging in strictly using Joomla (your module) and logging in using FaceBook login (your module).
Re 1a) No. Logging in through FaceBook does not redirect either - just stays on the same page.
Re 2) No. I do not have "Automatically Login Facebook Users" setting enabled.

I noticed above that I'm not the only one having this problem so I'm just wondering does it work on your own computer? If yes, what version do you use? I'm on version 3.3.0.

Thanks.
The topic has been locked.
Support Specialist
12 years 10 months ago #10546 by mel
Replied by mel on topic Login Redirect not working
You've found a bug in our code. It's due to a subtlety of Joomla that I missed when I was updating JFBConnect to work with 1.6. Below is a temporary code fix you can use until we put the next release out (which should be relatively soon).

In modules/mod_jfbclogin/helper.php around line 30, replace
$menu = JSite::getMenu();
$item = $menu->getItem($itemId);
if ($item)
   $url = $item->link . '&Itemid=' . $itemId;

with
$app = JFactory::getApplication();
$router = $app->getRouter();

$db = JFactory::getDbo();
//Derived from mod_login Joomla 1.6, but modified to be backwards compatible with 1.5
$query = "SELECT link FROM #__menu WHERE published=1 AND id=".$db->quote($itemId);
$db->setQuery($query);
if ($link = $db->loadResult())
{
    if ($router->getMode() == JROUTER_MODE_SEF)
    {
        $url = 'index.php?Itemid=' . $itemId;
    }
    else
    {
        $url = $link . '&Itemid=' . $itemId;
    }
}

This was tested on my localhost with Joomla 1.6.3
The topic has been locked.
Support Specialist
12 years 10 months ago #10547 by alzander
Replied by alzander on topic Login Redirect not working
Just one note to add: The code above is only for the JFBCLogin module and only changes the behavior when a user is logging in using Joomla credentials (username/password fields). For Facebook user's that are logging in, the redirection settings can be found in the main JFBConnect component configuration area under the Login/Logout Redirections tab. These settings work as expected from our testing, but if you do find problems with registered pages or something similar when logging in with a Facebook account, just let us know!
The topic has been locked.
Active Subscriptions:

None
12 years 10 months ago #10551 by ozidoggy
Replied by ozidoggy on topic Login Redirect not working
Works... Thanks heaps!
The topic has been locked.
Active Subscriptions:

None
12 years 10 months ago #10552 by decksys
Replied by decksys on topic Login Redirect not working
Yes, now it works. Thank you.
The topic has been locked.
Support Specialist
12 years 10 months ago #10564 by alzander
Replied by alzander on topic Login Redirect not working
Fantastic! Thanks for the feedback and confirmation of the fix. Again, this will be in the next release of JFBConnect, due out in a few days, so you won't have to re-implement it.

Alex
The topic has been locked.