EllisLab text mark
Advanced Search
2 of 5
2
   
New Extension Completed!! - Logout Redirect
Posted: 09 December 2007 01:44 PM   [ Ignore ]   [ # 19 ]   [ Rating: 0 ]
Joined: 2007-03-30
111 posts

Mark,

I feel I’m this close - It looks exactly like I want it now and it even logs me out the problem is that it still drops me back to my index and not Yahoo.

Hmm,
Chris

 
Posted: 09 December 2007 01:51 PM   [ Ignore ]   [ # 20 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Hi Chris,

Make sure that you are logging in on the user side and not the admin side of things first of all. See if that helps.

Login as a normal user using the user login form.
Try to logout.

It should then re-direct you to Yahoo or wherever you have set in the URL.

Hope that helps.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 09 December 2007 01:54 PM   [ Ignore ]   [ # 21 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Also for anyone else reading this at the moment. The extension / plugin currently works by writing the URL to a database table for that member. This is then used in the extension when the user logs out to re-direct them to where you want them to go to.

I will probably (hopefully) update this to use a cookie instead which is a little safer as there then won’t be any writing or deleting from the ExpressionEngine tables. At the moment though it writes to its own database table so there shouldn’t really be any worry there with your data but as always please do backup and test extensively before using this on any live sites, and, if in doubt, don’t use it!

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 12 December 2007 10:38 AM   [ Ignore ]   [ # 22 ]   [ Rating: 0 ]
Avatar
Joined: 2006-10-24
188 posts

Great to see you working on this Mark!

Regarding the login redirects, I’ve been using the method described by “iain” here:
http://ellislab.com/forums/viewthread/62282/

Seems to be a great solution except for the fact that you have to exclude those URLs in htaccess so Google doesn’t index all of your login pages.

 Signature 

dabbledoo.com | .(JavaScript must be enabled to view this email address)

Member of the EE Pro Network

 
Posted: 12 December 2007 10:53 AM   [ Ignore ]   [ # 23 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Hi there Dabbledoo!

Regarding the Login Redirect I have now written up a very simple way of doing this both in the WIKI and also a forum post. Hope that is of some use to some people.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 13 December 2007 03:51 PM   [ Ignore ]   [ # 24 ]   [ Rating: 0 ]
Avatar
Joined: 2003-02-12
419 posts

Mark,

Few thoughts. 

1. Why not use the $SESS cache to keep the redirect URL in?  Then you don’t need a table in the DB which is rather overkill for this kind of functionality.
2. You can probably check to see if a URL given has the http:// part and add it if necessary before writing it to the the above cache.  However you will also want to make sure the given URL doesn’t start with a valid template_group/template chunk.  If it does you don’t want to add the http:// part obviously.

Jamie

 
Posted: 13 December 2007 05:02 PM   [ Ignore ]   [ # 25 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Hi Jamie,

Hmm. I thought that the $SESS usage was only for on one page and couldn’t actually be used across pages to maintain state as normal sessions do?
How do you store items in $SESS then to work across pages with?

Thanks.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 13 December 2007 05:17 PM   [ Ignore ]   [ # 26 ]   [ Rating: 0 ]
Avatar
Joined: 2003-02-12
419 posts

Why do you need the info to survive across pages?

Maybe I didn’t understand quite how you were using it.

Jamie

 
Posted: 13 December 2007 07:11 PM   [ Ignore ]   [ # 27 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Hi Jamie,

Basically I had a plugin that allows you to set the URL that you want to be re-directed to upon logging out of the system. I was writing this to the database and then using the member_member_logout hook to log out of the system and then using the $FNS->redirect to get the user to where I wanted to send them to.

With the Login Redirect method that I have now added to the WIKI I am now handling this with a cookie on the users machine which is then used within the return=”“ parameter in the login form tag.

My problem with that one was when I made the extension I unfortunately didn’t quite understand how to program using the hooks effectively so pretty much ended up just copying most of the mod.member_auth.php into the extension and then changing the redirect to go where I wanted.

I definitely need a better understanding of how to use the hooks as I have lots of ideas that could (I think) be implemented into ExpressionEngine but I just didn’t know how to do them.

For instance with the Login Redirect extension which I made (now no longer on the forums due to licensing rules) I just wanted to change the return variable which was quite a way down the code in the php file after where the hook started but I didn’t know how to create all the same needed functions to log the person out and so that is why I ended up just taking the code from the file and adding it into the extension.

I thought that I needed the information to stay across a page as I was using a plugin to write the URL to the database and then when a person clicks on a logout link the extension kicks in and logs them out then re-directs them to the URL.

Is there an easier way and can sessions be used for maintaining state?

I would love to learn how to do this with an extension as I would really love to learn how to write them correctly.

Any help with this would be massively appreciated.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 18 December 2007 09:42 AM   [ Ignore ]   [ # 28 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Hi Jamie,

Was just wondering if you had any more news on this at all? Can $SESS be used to store data across a page call then?

Thanks.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 18 December 2007 05:44 PM   [ Ignore ]   [ # 29 ]   [ Rating: 0 ]
Avatar
Joined: 2003-02-12
419 posts

Hey Mark,

Sorry, I’ve been a bit crushed for time lately.  I’m actually not quite sure.  You could certainly try it and let me know.  smile

Jamie

 
Posted: 28 December 2007 12:27 PM   [ Ignore ]   [ # 30 ]   [ Rating: 0 ]
Joined: 2005-03-30
68 posts

Hi Mark,

I receive this error when I try to enable the extension.  I’m using version 1.5.2.

Thanks!!

Notice: Undefined variable: default_settings in /home/thund6/public_html/site/admin/extensions/ext.logout_redirect.php on line 51

Notice: Undefined variable: sql in /home/thund6/public_html/site/admin/extensions/ext.logout_redirect.php on line 66

Warning: Invalid argument supplied for foreach() in /home/thund6/public_html/site/admin/extensions/ext.logout_redirect.php on line 66

Warning: Cannot modify header information - headers already sent by (output started at /home/thund6/public_html/site/admin/extensions/ext.logout_redirect.php:51) in /home/thund6/public_html/site/admin/core/core.functions.php on line 293

 Signature 

———————————-
Andrea Beight
2TechChicks Network

 
Posted: 28 December 2007 07:41 PM   [ Ignore ]   [ # 31 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Hi there Andrea,

Unfortunately I have never tested this extension / plugin on anything less than 1.6.1 so not entirely sure if it will work or not. I think that some of the functions that I am using are 1.6.1 specific so I think an upgrade would be needed for this to work for you.

I am away now for a few days for New Year and so won’t be at a computer for a while but when I get back I will look at making a much simpler version of this and upload it for everyone.

Sorry about that.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
Posted: 26 February 2008 06:55 PM   [ Ignore ]   [ # 32 ]   [ Rating: 0 ]
Avatar
Joined: 2006-08-02
1257 posts

Hi Mark,

Seems like a great extension, just what I need I think. I’m wondering though, can you redirect the user to the page they were on previously before clicking “logout?” I’d just like to let them to back to their previous page rather than another page like http://www.yahoo.com  .

I read through this thread quickly but didn’t see anything. My apologies if I overlooked this.

 Signature 

Deron Sizemore
==========
LogoGala | Kentucky Golfing
Twitter: Deron Sizemore | LogoGala

 
Posted: 27 February 2008 05:56 AM   [ Ignore ]   [ # 33 ]   [ Rating: 0 ]
Avatar
Joined: 2006-04-15
12649 posts

Hi Deron,

Not sure if I am understanding your question correctly but let’s say you are on a page with the following kind of template / url structure :

http://www.mysite.com/my-template-group/my-template/my_url_title

If you now placed the following code on that page :

{exp:logout_redirect url="http://www.mysite.com/my-template-group/my-template/my_url_title" text="Get Me Out Now" styles="class='logout-link-class' title='Logout Link'"

That should (I think) be doing what you are asking? The http://www.yahoo.com was just placed in there as an example but it can be anything you like really and seeing as how the plugin/extension code is placed on the page that you want to log out from then just placing the same url in there should take you back there again hopefully.

Hope that helps.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin | Full List Of Add-Ons | About Me
——————————————————————————————
2.x Bug Tracker | Upgrade Errors

 
2 of 5
2