Mark,
Any thoughts about this.
Notice: Undefined variable: default_settings in /home/virtual/site179/fst/var/www/html/expressionEngine/system/extensions/ext.login_redirect.php on line 51
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site179/fst/var/www/html/expressionEngine/system/extensions/ext.login_redirect.php:51) in /home/virtual/site179/fst/var/www/html/expressionEngine/system/core/core.functions.php on line 296
I cleared out the old versions and reinstalled them then went to extension manager and enabled it when it asked to confirm my action I got the above message on a white screen.
Your thoughts, Chris
Hi Chris,
Sorry about that. Are you using the Logout Redirect extension that I have made or the Login Redirect extension? I only ask as what you have shown above is an error with exp.login_redirect.php shown in it. The Logout Redirect extension has nothing in it that would spit out that error.
The easiest way to start again, although this involves messing with the database is to delete any rows from exp_extensions that contain Logout_redirect if it is indeed the Logout Redirect extension that you are trying to use?
Also delete the table exp_logout_redirect_url. You should then be able to try again.
Still wondering why you are getting the error message that you have there though as that says ext.login_redirect.php and shouldn’t be saying that if you are trying the Logout Redirect extension.
Hope that helps.
Best wishes,
Mark
Mark,
No need to apologize I’m just happy that their are people out in the EE community that are willing to help like this. I can only hope as my experience grows that I can begin to give back.
I figured out what I had going on, I got mixed up between Logout and Login, just got caught up doing and didn’t read.
What do think about the possibilities of wrapping the code below with your extension and making it work.
<span class="log"><a href="#">LOG-OUT</a></span>
Your thoughts, Chris
Hi Chris,
No problem at all. All this is really new to me too (the creating extensions I mean) and I went through tons and tons of changes until this worked. At least I hope it all works well! 😊
What exactly do you want your logout link to look like? Do you just want to wrap a span class around it. If so then I think this would probably work :
<span class="log">
{exp:logout_redirect url="http://www.yahoo.com" text="Log Out To Yahoo" styles="class='main'"}
</span>
The plugin is at the moment just a single tag and not a tag pair so in itself it can’t be wrapped around anything but the code above should get what you need if I am understanding correctly.
Hope that helps.
Best wishes,
Mark
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
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
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.
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
Mark,
Few thoughts.
Jamie
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
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.