using a logout URL instead of button -- setting the result p
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
- ooffick
- Joomla! Master
- Posts: 11615
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: using a logout URL instead of button -- setting the result p
You can use the mod_login module for that though.
Olaf
Olaf
Last edited by ooffick on Sat Jun 13, 2009 8:04 pm, edited 1 time in total.
Reason: Edit: It is possible to use the logout without a token
Reason: Edit: It is possible to use the logout without a token
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Explorer
- Posts: 265
- Joined: Thu Aug 09, 2007 2:08 pm
- ooffick
- Joomla! Master
- Posts: 11615
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: using a logout URL instead of button -- setting the result p
Actually sorry, you can do logout without a token:
Did you try this one as normal external address:
index.php?option=com_user&return=Lw&task=logout
Olaf
Did you try this one as normal external address:
index.php?option=com_user&return=Lw&task=logout
Olaf
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Explorer
- Posts: 265
- Joined: Thu Aug 09, 2007 2:08 pm
Re: using a logout URL instead of button -- setting the result p
Perfect. Works like a charm. Thnxooffick wrote:Actually sorry, you can do logout without a token:
Did you try this one as normal external address:
index.php?option=com_user&return=Lw&task=logout
Olaf
-
- Joomla! Explorer
- Posts: 265
- Joined: Thu Aug 09, 2007 2:08 pm
Re: using a logout URL instead of button -- setting the result p
One more. Do you know how I can hide the virtuemart login box, after the user is logged in?
- ooffick
- Joomla! Master
- Posts: 11615
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: using a logout URL instead of button -- setting the result p
You could use the Extension MetaMod to do that.
Olaf
Olaf
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Explorer
- Posts: 265
- Joined: Thu Aug 09, 2007 2:08 pm
Re: using a logout URL instead of button -- setting the result p
I use rockaccess, dont know if I can use MetaMod too or do I get a conflict? But how do I use it then?
- ooffick
- Joomla! Master
- Posts: 11615
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: using a logout URL instead of button -- setting the result p
Well, as far as I know rokaccess is a content plugin.
If you want to hide a module (when you logged in) you would need to use e.g. MetaMod. Add it instead of the module you want to hide and then add into the parameters of that module:
44 = Module ID of the Module which you want to display when the user is logged in
45 = Module ID of the Module which you want to display when the user is logged out
Olaf
If you want to hide a module (when you logged in) you would need to use e.g. MetaMod. Add it instead of the module you want to hide and then add into the parameters of that module:
Code: Select all
if ( MM_NOT_LOGGED_IN ) return 44; else return 45;
45 = Module ID of the Module which you want to display when the user is logged out
Olaf
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Explorer
- Posts: 265
- Joined: Thu Aug 09, 2007 2:08 pm
Re: using a logout URL instead of button -- setting the result p
Awesome. It works. Can't believe it. It works.
Thank you.
Thank you.
- tusker
- Joomla! Ace
- Posts: 1075
- Joined: Tue Dec 25, 2007 2:15 pm
- Location: Baroda - India
- Contact:
Re: using a logout URL instead of button -- setting the result p
use module instead of menu link... you can achieve it that way..
ONE WORLD OPEN WORLD - WAR TODAY GIVE PEACE A CHANCE
http://indiavoice.info - India News & Information Portal
http://indiadaily.indiavoice.info - India Daily Infotainment
(Powered by Joomla!)
http://indiavoice.info - India News & Information Portal
http://indiadaily.indiavoice.info - India Daily Infotainment
(Powered by Joomla!)
-
- Joomla! Explorer
- Posts: 265
- Joined: Thu Aug 09, 2007 2:08 pm
-
- Joomla! Fledgling
- Posts: 2
- Joined: Thu Apr 24, 2008 1:06 pm
Re: using a logout URL instead of button -- setting the result p
Hello,
Guys this solution is exactly the thing I was looking for.
It saves one click for the user by not showing the logout link as a part of module in the content but by logging out directly.
It is in my opinion smoother way of logout. More user firendly.
Thanks for sharing your knowledge...
Regards,
Dariusz
Guys this solution is exactly the thing I was looking for.
It saves one click for the user by not showing the logout link as a part of module in the content but by logging out directly.
It is in my opinion smoother way of logout. More user firendly.
Thanks for sharing your knowledge...
Regards,
Dariusz
Last edited by ooffick on Fri Oct 09, 2009 9:05 am, edited 1 time in total.
Reason: Mod Note: Deleted Manual Signature. Please read the Forum Rules for details
Reason: Mod Note: Deleted Manual Signature. Please read the Forum Rules for details
-
- Joomla! Fledgling
- Posts: 1
- Joined: Tue Mar 23, 2010 4:32 pm
Re: using a logout URL instead of button -- setting the result p
Sorry to dig up such an old post, but Olaf is my hero. Exactly what I was looking for. Thanks much!
ooffick wrote:Can you try this one:
Do you have access to your error log file? to see if there are any errors? Do you have PHP4 or PHP5?Code: Select all
index.php?option=com_user&task=logout&return=aW5kZXgucGhw
Olaf
-
- Joomla! Fledgling
- Posts: 2
- Joined: Tue Apr 27, 2010 6:53 pm
Re: using a logout URL instead of button -- setting the result p
Just a quick snippet for anybody who runs across this post. This link will redirect the user to whichever page they are currently on after they are logged out.
Code: Select all
<?php
// get the user object
$user = &JFactory::getUser();
// get the current Joomla base url
$base = JURI::current();
// encode the current base url for use in redirection
$redirect = base64_encode($base);
/* is the user logged in? if user is logged in,
display Log Out link with redirection to
current page */
if ($user->get('gid')) { ?>
<a href="index.php?option=com_user&task=logout&return=<?php echo $redirect; ?>">Log Out</a>
<?php } ?>