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.
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
jonactionbase
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Oct 15, 2008 3:31 pm
Location: Israel
Contact:

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

Postby jonactionbase » Thu Oct 16, 2008 7:37 am

I'm using Joomla! 1.5
I've been trying to set up a link to allow users to logout (instead of the logout button).

I've managed to do this, by pointing a menu item to:

Code: Select all

index.php?option=com_user&task=logout


joomla adds

Code: Select all

&Itemid=136
because it's a menu item.

With or without the itemid, the user is taken to a blank page. Since I'm not invoking the login module directly, I suppose that's why my settings aren't taken from there.

How do I get the user to the start page instead of an empty page?
Any ideas?
http://www.actionbase.com ActionBase - Connecting People & Process
Signature rules - only literal url's

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11055
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

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

Postby ooffick » Thu Oct 16, 2008 1:58 pm

As far as I know you will need to use a Form to submit this, as you need some of the hidden fields to logout.

Olaf
Olaf Offick - Global Moderator
http://learnskills.org

User avatar
jonactionbase
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Oct 15, 2008 3:31 pm
Location: Israel
Contact:

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

Postby jonactionbase » Thu Oct 16, 2008 2:11 pm

Hi, olaf.

Thanks, but I've managed to logout successfully.
It's the page I'm taken to that is bothering me.

However, maybe a form is the way to go in order to tell Joomla what to do. I'll put a link with a POST method.
But then I need to process the form, which I'm not sure what to do with.

Now I just need to figure out how to do that.

Anyone got an idea?

J.
http://www.actionbase.com ActionBase - Connecting People & Process
Signature rules - only literal url's

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11055
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

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

Postby ooffick » Thu Oct 16, 2008 2:15 pm

well, you might want to try to add the hidden base64 encoded return URL parameter as well, I am not sure if you used that.

Olaf
Olaf Offick - Global Moderator
http://learnskills.org

User avatar
jonactionbase
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Oct 15, 2008 3:31 pm
Location: Israel
Contact:

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

Postby jonactionbase » Thu Oct 16, 2008 3:37 pm

ooffick wrote:well, you might want to try to add the hidden base64 encoded return URL parameter as well, I am not sure if you used that.

Olaf

I didn't use a form at all.

I created a menu with a single menu item, of a "link" type, that points to the logout url.

Should I replace this with a custom html module and write a small form, with a link and "post" method?

J.
http://www.actionbase.com ActionBase - Connecting People & Process
Signature rules - only literal url's

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11055
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

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

Postby ooffick » Thu Oct 16, 2008 3:48 pm

Sorry, what I meant was add the parameter return=[your-base64-encoded-return-URL] so your URL looks like this:

Code: Select all

index.php?option=com_user&task=logout&return=L2luZGV4LnBocD90cD0x


Olaf
Olaf Offick - Global Moderator
http://learnskills.org

User avatar
jonactionbase
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Oct 15, 2008 3:31 pm
Location: Israel
Contact:

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

Postby jonactionbase » Thu Oct 16, 2008 3:59 pm

ooffick wrote:Sorry, what I meant was add the parameter return=[your-base64-encoded-return-URL] so your URL looks like this:

Code: Select all

index.php?option=com_user&task=logout&return=L2luZGV4LnBocD90cD0x


Olaf


Oooooh. Sweet.
I'll have to try this next week.

Thanks a mil, Olaf!
http://www.actionbase.com ActionBase - Connecting People & Process
Signature rules - only literal url's

User avatar
jonactionbase
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Oct 15, 2008 3:31 pm
Location: Israel
Contact:

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

Postby jonactionbase » Thu Oct 23, 2008 9:36 am

ooffick wrote:Sorry, what I meant was add the parameter return=[your-base64-encoded-return-URL] so your URL looks like this:

Code: Select all

index.php?option=com_user&task=logout&return=L2luZGV4LnBocD90cD0x


Olaf


Okay, I tried playing around with this, but it didn't work out.

a. I'm either not properly encoding my URL.
b. Joomla doesn't automatically decode the URL (would I need to parse it myself in PHP?)
c. I'm completely off target.

How should I encode the URL? Should I do it once, and then paste the code into the return parameter?

Should I still be using a menu with a link, or should I render my own <div> with a link inside?

Thanks for your help.
http://www.actionbase.com ActionBase - Connecting People & Process
Signature rules - only literal url's

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11055
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

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

Postby ooffick » Thu Oct 23, 2008 10:16 am

Which Joomla version do you use?
Which URL do you want to link to?

Olaf
Olaf Offick - Global Moderator
http://learnskills.org

User avatar
jonactionbase
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Oct 15, 2008 3:31 pm
Location: Israel
Contact:

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

Postby jonactionbase » Thu Oct 23, 2008 11:40 am

I'm using Joomla 1.5

I'd like the logout link to go to the homepage when clicked.

I tried encoding "/".

I tried encoding the full URL (it's on our intranet).
I tried using the encoder I foundwhile googling the subject.
http://www.actionbase.com ActionBase - Connecting People & Process
Signature rules - only literal url's

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11055
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

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

Postby ooffick » Thu Oct 23, 2008 12:23 pm

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

User avatar
jonactionbase
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Oct 15, 2008 3:31 pm
Location: Israel
Contact:

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

Postby jonactionbase » Thu Oct 23, 2008 12:32 pm

1. You ROCK. It works.
2. What did you do, and how would I go about doing it myself, in the future?
Ah... I see

Code: Select all

"aW5kZXgucGhw" = index.php


ok. But then, what if I want to use SEF URLs?

3. We're using PHP5. Is there something specific you're interested in from the error log?
http://www.actionbase.com ActionBase - Connecting People & Process
Signature rules - only literal url's

User avatar
jonactionbase
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Oct 15, 2008 3:31 pm
Location: Israel
Contact:

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

Postby jonactionbase » Thu Oct 23, 2008 12:33 pm

jonactionbase wrote:ok. But then, what if I want to use SEF URLs?



You encode the name of the page you'd like to go to, genius.

But really, what if I just want it to go to the root...?
http://www.actionbase.com ActionBase - Connecting People & Process
Signature rules - only literal url's

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11055
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

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

Postby ooffick » Thu Oct 23, 2008 12:43 pm

The index.php file is the root.
SEF is not a problem as the other files work as the SEF file works as well.

But you could also try this one:

Code: Select all

index.php?option=com_user&task=logout&return=Lw


Olaf
Olaf Offick - Global Moderator
http://learnskills.org

User avatar
jonactionbase
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Oct 15, 2008 3:31 pm
Location: Israel
Contact:

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

Postby jonactionbase » Thu Oct 23, 2008 12:58 pm

Aaah.

'cos the calculator kept encoding "/" it as "Lw==" and I couldn't find a way to encode the URL properly.

Great.

Now All Is Well.

Thanks again, Olaf!

J.
http://www.actionbase.com ActionBase - Connecting People & Process
Signature rules - only literal url's

Dynamic Fun
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Jan 30, 2009 12:57 pm

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

Postby Dynamic Fun » Sat Jan 31, 2009 4:39 am

ooffick wrote:The index.php file is the root.
SEF is not a problem as the other files work as the SEF file works as well.

But you could also try this one:

Code: Select all

index.php?option=com_user&task=logout&return=Lw


Olaf

This is exactly what I came searching to find today.
Thank you. :)

User avatar
Whitebread
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Wed Dec 17, 2008 6:27 pm
Contact:

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

Postby Whitebread » Wed Feb 04, 2009 3:50 pm

Thats awesome!
I had completely forgot that I was trying to do this. It works great, thanks for the posts!
Jason P Bunn
Web Developer
http://www.virburbia.com

User avatar
tr2n
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu Nov 13, 2008 7:32 pm
Location: Mexico

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

Postby tr2n » Wed Feb 04, 2009 4:49 pm

Great, it works just fine, thanks!

User avatar
JuanOrtiz
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Feb 11, 2009 12:31 pm

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

Postby JuanOrtiz » Wed Feb 11, 2009 1:31 pm

Hey everybody! this post helped me a lot!
Here you can encode text to 64:
http://www.motobit.com/util/base64-decoder-encoder.asp
Please read forum rules regarding signatures: viewtopic.php?f=8&t=65

marahibsat
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Feb 24, 2009 11:10 pm

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

Postby marahibsat » Wed Mar 25, 2009 4:58 pm

I want only to thank Olaf as he saved me time today, he gave two solutions, one on my thread and this one for url to logout
You are so loved Olaf, if you need help in satellite just google my name

marahibsat

User avatar
selimoff
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Apr 08, 2009 1:17 am

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

Postby selimoff » Mon May 11, 2009 10:19 am

Olaf, Joomla Hero!!!
Thanks

agarza
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu Sep 27, 2007 4:40 pm

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

Postby agarza » Thu May 21, 2009 5:03 pm

Life saver! Exactly what I was looking for. :D :D :D

Thanks Olaf

MAD King
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 149
Joined: Thu Aug 09, 2007 2:08 pm

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

Postby MAD King » Sat Jun 13, 2009 12:46 am

Could anyone explain me how to do this?

I always get the Menu item number at the end of the link.

Thnx

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11055
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

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

Postby ooffick » Sat Jun 13, 2009 8:33 am

You can set the URL yourself if you want to.

Olaf
Olaf Offick - Global Moderator
http://learnskills.org

MAD King
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 149
Joined: Thu Aug 09, 2007 2:08 pm

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

Postby MAD King » Sat Jun 13, 2009 2:24 pm

How?

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

Postby tusker » Sat Jun 13, 2009 2:37 pm

is it working with SEF urls enabled?
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!)

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11055
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

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

Postby ooffick » Sat Jun 13, 2009 2:39 pm

MAD King wrote:How?

Did you try the external link type in the Menu Item?
What exactly do you want to do anyway?

Olaf
Olaf Offick - Global Moderator
http://learnskills.org

MAD King
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 149
Joined: Thu Aug 09, 2007 2:08 pm

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

Postby MAD King » Sat Jun 13, 2009 2:52 pm

I want the logout link in the user menu. But when I use the external link option it gives me a item id at the end and that comes up with an error after clicking the link.

User avatar
ooffick
Joomla! Master
Joomla! Master
Posts: 11055
Joined: Thu Jul 17, 2008 3:10 pm
Location: Ireland
Contact:

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

Postby ooffick » Sat Jun 13, 2009 3:08 pm

Why don't you use the following:

  1. Go to the Menu Manager
  2. Find your Menu
  3. Click on the Edit Menu Items Icon
  4. Click on New
  5. Click on User
  6. Click on "Default Login Layout"
  7. set Access Level = Registered
  8. set title = "Logout"
  9. set alias = "Logout"
  10. set Logout Redirection URL to whatever URL you want e.g. /index.php
  11. Click on Save

Olaf
Olaf Offick - Global Moderator
http://learnskills.org

MAD King
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 149
Joined: Thu Aug 09, 2007 2:08 pm

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

Postby MAD King » Sat Jun 13, 2009 5:20 pm

Thank you. But is there a way if I click on the logout link that I looged out without redirect to the extra page with the logout button?


Return to “Administration 1.5”

Who is online

Users browsing this forum: No registered users and 12 guests