using a logout URL instead of button -- setting the result p

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

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.
User avatar
ooffick
Joomla! Master
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

Post by ooffick » Sat Jun 13, 2009 7:30 pm

You can use the mod_login module for that though.

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
Olaf Offick - Global Moderator
learnskills.org

MAD King
Joomla! Explorer
Joomla! Explorer
Posts: 265
Joined: Thu Aug 09, 2007 2:08 pm

Re: using a logout URL instead of button -- setting the result p

Post by MAD King » Sat Jun 13, 2009 7:39 pm

OK. Thank you

User avatar
ooffick
Joomla! Master
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

Post by ooffick » Sat Jun 13, 2009 8:02 pm

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
Olaf Offick - Global Moderator
learnskills.org

MAD King
Joomla! Explorer
Joomla! Explorer
Posts: 265
Joined: Thu Aug 09, 2007 2:08 pm

Re: using a logout URL instead of button -- setting the result p

Post by MAD King » Sat Jun 13, 2009 9:03 pm

ooffick 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
Perfect. Works like a charm. Thnx

MAD King
Joomla! Explorer
Joomla! Explorer
Posts: 265
Joined: Thu Aug 09, 2007 2:08 pm

Re: using a logout URL instead of button -- setting the result p

Post by MAD King » Sat Jun 13, 2009 9:04 pm

One more. Do you know how I can hide the virtuemart login box, after the user is logged in?

User avatar
ooffick
Joomla! Master
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

Post by ooffick » Sat Jun 13, 2009 9:13 pm

You could use the Extension MetaMod to do that.

Olaf
Olaf Offick - Global Moderator
learnskills.org

MAD King
Joomla! Explorer
Joomla! Explorer
Posts: 265
Joined: Thu Aug 09, 2007 2:08 pm

Re: using a logout URL instead of button -- setting the result p

Post by MAD King » Sat Jun 13, 2009 9:26 pm

I use rockaccess, dont know if I can use MetaMod too or do I get a conflict? But how do I use it then?

User avatar
ooffick
Joomla! Master
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

Post by ooffick » Sat Jun 13, 2009 10:42 pm

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:

Code: Select all

if ( MM_NOT_LOGGED_IN ) return 44; else return 45;
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
Olaf Offick - Global Moderator
learnskills.org

MAD King
Joomla! Explorer
Joomla! Explorer
Posts: 265
Joined: Thu Aug 09, 2007 2:08 pm

Re: using a logout URL instead of button -- setting the result p

Post by MAD King » Sun Jun 14, 2009 12:30 am

Awesome. It works. Can't believe it. It works.

Thank you.

User avatar
tusker
Joomla! Ace
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

Post by tusker » Tue Jun 16, 2009 1:03 pm

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!)

MAD King
Joomla! Explorer
Joomla! Explorer
Posts: 265
Joined: Thu Aug 09, 2007 2:08 pm

Re: using a logout URL instead of button -- setting the result p

Post by MAD King » Tue Jun 16, 2009 1:52 pm

I did. Thnx

darasso1
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Apr 24, 2008 1:06 pm

Re: using a logout URL instead of button -- setting the result p

Post by darasso1 » Fri Oct 09, 2009 8:12 am

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
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

gscott_24
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Mar 23, 2010 4:32 pm

Re: using a logout URL instead of button -- setting the result p

Post by gscott_24 » Tue Mar 23, 2010 4:46 pm

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:

Code: Select all

index.php?option=com_user&task=logout&return=aW5kZXgucGhw
Do you have access to your error log file? to see if there are any errors? Do you have PHP4 or PHP5?

Olaf

mike_fowler
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Apr 27, 2010 6:53 pm

Re: using a logout URL instead of button -- setting the result p

Post by mike_fowler » Tue Apr 27, 2010 6:57 pm

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 } ?>


Locked

Return to “Administration 1.5”