Topic-icon [Solved] External url Logout redirect - 404 - Component not found

Active Subscriptions:

None
Hi,
I am trying to set a logout redirection for jfbconnect but it seems whenever I set an external url I receive a "404 - Component not found" error at www.mysite.com/?Itemid=640. The redirection works fine with internal url's.

Is there a reason why jfbconnect doesn't allow for external url logout redirection? If so, is there a way around this?

Thanks.
The topic has been locked.
Support Specialist
We've never had that question asked of us actually, so never tested it. I believe in the upcoming 4.1 release, we actually would support external URLs because we're handling the redirections a bit differently to enhance compatibility with some 3rd party extensions.

For now, if you wanted to do that, you'd have to hardcode the URL you want the redirection to go to. It should be pretty easy. In the /components/com_jfbconnect/controller.php file, at the very bottom, you'll see:
$app->redirect($return);
Simply change that to:
$app->redirect('http://external-site.com/');
Hope that helps (and works)!
Alex
The topic has been locked.
Active Subscriptions:

None

alzander wrote: It should be pretty easy. In the /components/com_jfbconnect/controller.php file, at the very bottom, you'll see:

$app->redirect($return);
Simply change that to:
$app->redirect('http://external-site.com/');
Hope that helps (and works)!
Alex


Hi,
I found the controller.php file but the line of code you were referring to was not there.

Thanks.
The topic has been locked.
Support Specialist
David,
Make sure you're checking the right file. It should be at:
/components/com_jfbconnect/controller.php (not in the administrator directory)

Then, toward the bottom, you'll see a function named "logout()". At the very bottom of this (and the very bottom of the whole file), you should definitely see that line.

Let us know how it goes,
Alex
The topic has been locked.
Active Subscriptions:

None
Hi Alex,

Thanks for that, I was very pleased with the way it works.

I'm actually using the logout re-direction to point to facebook.com - which leads me to ask for the following feature request.

Background:

Most of my website's users are travellers and approximately 50% will log into my site from public internet facilities such as internet cafes, libraries and hostels ie not their personal computer. I have noticed that if a user is not logged in to facebook, but they use there fb credentials to log in to my site, often they are unaware that they have opened up a fb session. If they then logout of my site, and do not subsequently visit facebook, there is a high chance they will walk away from the computer leaving an active fb session open on a public computer. The idea of re-directing to fb is to show the user that they did in fact have an open fb session. This is not ideal, and will not work 100% of the time, but it will mean I do not have to force all my users to logout of facebook when they log out of my site.

Setting "Log out of Joomla only - No", would solve the problem of leaving active fb sessions open in public places, but - as I am sure you are aware - it can be a bit of a pain for other users. What I would like, is for the afore mentioned option in the back-end to be presented in a similar way to users in the front-end. So when a user logs outs of my site they are presented with the option "Logout of active Facebook session too?". That way, rather then the site administrator determining what the best logout option is for all users, the users can decide for themselves.

Anyway, I could not find a 'feature request' section in this forum so I thought I would post it here.

Thanks again for your help.
The topic has been locked.
Support Specialist
David,
Thanks for the feature suggestion. We've never heard that one before, but get most of our ideas from users like you, so we definitely appreciate the feedback.

This isn't something we'd do immediately, because, if you know most of your users are travelers, we'd simply recommend you log them out of both sites as a safety/courtesy. Of course, that setting only works for users that are currently logged into your site through Facebook, so if a user visits your site while logged into Facebook but hasn't connected it to their Joomla account, it wouldn't 'randomly' log them out.

Just so you know, if you're redirecting logouts from JFBConnect to Facebook, that would include user's that aren't 'connected' to Facebook. So, even if a standard Joomla user logs out, and uses the a Logout button from JFBConnect, they will go there as well... which will likely be a bit confusing as well.

Hope that helps, and if you have any other suggestions, definitely let us know.

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

None
Hi Alex,

Thanks for getting back to me. I appreciate you considering my request and understand it's probably not a feature the majority of your subscribers would use.
Just out of curiosity though, if I was to hire a freelancer to do this customisation for me, what type of skills would they need? eg php expertise. When a user hits 'Logout" I want them to be presented with a pop up box or ajax thingy that shows "Log out of facebook too?" with options "yes" or "no" to choose from.

Cheers.
The topic has been locked.
Support Specialist
David,
For a simple Javascript confirmation popup, we can help you with that.. just may not implement it in a future release. To do what you're looking for, you'll need to edit the /components/com_jfbconnect/includes/jfbconnect.js file. Around line 40, you'll see:
if (response.status === 'connected')
{
   FB.logout(function(response) {
      jfbc.login.redirect_to_logout();
   });
}
else
{
   jfbc.login.redirect_to_logout();
}
Change that too the below, using the // ADD THIS to indicate lines that need to be included:
if (response.status === 'connected')
{
   if (confirm("Do you want to logout of Facebook too? Click Cancel to logout of this site only.")) // ADD THIS
   { // ADD THIS
      FB.logout(function(response) {
         jfbc.login.redirect_to_logout();
      });
   } else // ADD THIS
         jfbc.login.redirect_to_logout(); // ADD THIS
}
else
{
   jfbc.login.redirect_to_logout();
}

For this to work, you'll need the "Logout of Joomla Only" setting disabled. Then, the user should get a prompt to logout of Facebook and your site.

This is completely untested, so test, test, test, and let us know if you run into any issues.

Good luck, and thanks for subscribing to JFBConnect,
Alex
The topic has been locked.
Active Subscriptions:

None
Hi Alex,

I was impressed that you posted that code for me. - thank you!

I couldn't see any effect after editing the js file and setting "Logout of Joomla Only" to disabled. It's quite likely an error on my behalf though, as I have no experience with editing js and the format looked somewhat complicated.
The topic has been locked.
Support Specialist
No problem for the code. Sorry it didn't work :)

Can you post (or private message) the URL of your site so we can see the results? We'll help you get that going, no doubt. Helping users make minor modifications to make JFBConnect fit their site is what you get with a subscription. We feel it's only right, and it also helps us see how different things may work for future releases.

Thanks
Alex
The topic has been locked.