3 of 4
3
New Extension Completed!! - Logout Redirect
Posted: 27 February 2008 09:40 AM   [ Ignore ]   [ # 37 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6579
Joined  04-15-2006

Yep sounds like a good idea. Give it a go and see wink

Hopefully should do what you want?

Also this is not the only way of using or should I say programming this plugin but just one of the ways. I think that once you have seen it working once and the way that it does what it does then you should definitely be able to get what you need with this.

Keep me informed on your progress though.

Speak to you soon.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 29 February 2008 02:51 PM   [ Ignore ]   [ # 38 ]  
Summer Student
Total Posts:  24
Joined  09-20-2006

I’am testing this hardcode

{if segment_1 == ""}
{exp
:logout_redirect url="http://www.domain.com/" text="Logout" styles="class="logout-link-class"}
{if:elseif segment_2 == ""}
{exp:logout_redirect url="
http://www.domain.com/{segment_1}" text="Logout" styles="class="logout-link-class"}
{if:elseif segment_3 == ""}
{exp
:logout_redirect url="http://www.domain.com/{segment_1}/{segment_2}" text="Logout" styles="class="logout-link-class"}
{if:elseif segment_4 == ""}
{exp:logout_redirect url="
http://www.domain.com/{segment_1}/{segment_2}/{segment_3}" text="Logout" styles="class="logout-link-class"}
{if:elseif segment_5 == ""}
{exp
:logout_redirect url="http://www.domain.com/{segment_1}/{segment_2}/{segment_3}/{segment_4}" text="Logout" styles="class="logout-link-class"}
{if:elseif segment_6 == ""}
{exp:logout_redirect url="
http://www.domain.com/{segment_1}/{segment_2}/{segment_3}/{segment_4}/{segment_5}" text="Logout" styles="class="logout-link-class"}
{if:else}
{exp
:logout_redirect url="http://www.domain.com/{segment_1}/{segment_2}/{segment_3}/{segment_4}/{segment_5}/{segment_6}" text="Logout" styles="class="logout-link-class"}
{/if}

It’s work, but redirected URL has “//////” at the end

Profile
 
 
Posted: 29 February 2008 03:58 PM   [ Ignore ]   [ # 39 ]  
Summer Student
Total Posts:  24
Joined  09-20-2006

{if logged_in}
{exp
:logout_redirect url="<?=substr($_SERVER['PHP_SELF'],10)?>" text="Logout" styles="title='Logout user' class='logout-link-class'"}
{
/if}

That’s exactly what I’m looking for :)

Profile
 
 
Posted: 09 March 2008 09:38 PM   [ Ignore ]   [ # 40 ]  
Grad Student
Avatar
Rank
Total Posts:  42
Joined  10-10-2007

Hi Mark, first of all thank you for the extension and keep up the good work.

I have a small issue about using the redirect more than once.

e.g.

{if logged_in}
{if member_group
== "1"}
{exp
:logout_redirect url="http://www.yahoo.com" text="yahoo.com" styles="class='logout' title='Logout to yahoo.com'"}
{
/if}
{
/if}
{if logged_in}
{if member_group
== "8"}
{exp
:logout_redirect url="http://www.google.com" text="google.com" styles="class='logout' title='Logout to google.com'"}
{
/if}
{
/if}

also


{if logged_in}
{if member_group
== "1"}
{exp
:logout_redirect url="http://www.yahoo.com" text="yahoo.com" styles="class='logout' title='Logout to yahoo.com'"}
{if
:else}
{exp
:logout_redirect url="http://www.google.com" text="google.com" styles="class='logout' title='Logout to google.com'"}
{
/if}
{
/if}

On both occasion, user is redirected to http://www.google.com and what’s more interesting is their logout text is displayed correctly! So, for “Super Admin” they see “yahoo.com” for logout and for member_group == “8” or else they see google.com.

Any ideas?

 Signature 

.
<bio> Cem Meric | Kalkadoon | Melbourne, AU </bio>
<creative> to | amf | kmscpa | siren | hidc </creative>

Profile
 
 
Posted: 14 March 2008 02:06 PM   [ Ignore ]   [ # 41 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  484
Joined  01-23-2006

Hi Mark,

Would it be possible to use this extension if your logout link was an image like:

<a href="{path=logout}"><img src="/images/gcn/bu_memberlogout.gif" alt="Log Out" width="110" height="18" /></a>

Thanks

Profile
 
 
Posted: 23 April 2008 09:58 AM   [ Ignore ]   [ # 42 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  206
Joined  06-18-2007

Hey Mark… quick update.

I’ve just installed this extension and plugin and all works wonderful with one exception. Upon enabling the extension, I get the following error:

Notice: Undefined variable: default_settings in /Volumes/A/WebSites/jcicms.com/jciads/backend/extensions/ext.logout_redirect.php on line 51

Notice
: Undefined variable: sql in /Volumes/A/WebSites/jcicms.com/jciads/backend/extensions/ext.logout_redirect.php on line 66

Warning
: Invalid argument supplied for foreach() in /Volumes/A/WebSites/jcicms.com/jciads/backend/extensions/ext.logout_redirect.php on line 66

Warning
: Cannot modify header information - headers already sent by (output started at /Volumes/A/WebSites/jcicms.com/jciads/backend/extensions/ext.logout_redirect.php:51) in /Volumes/A/WebSites/jcicms.com/jciads/backend/core/core.functions.php on line 296


The extension still works as it should without problems, and shows as being enabled, I just get the error on initial enabling. Should we be concerned? I’m running EE 1.6.3 with no mods or hacks as I’m starting a new project.

Also, one more question… can this be used in conjunction with your FetchURI extension?

Thanks.

Profile
 
 
Posted: 11 May 2008 02:29 PM   [ Ignore ]   [ # 43 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1570
Joined  08-02-2006

Mark,

I’m getting the same message that JCI is getting above when enabling the extension.

Also, I can’t get it to work either. I’ve copied/pasted your exact example code in the first post in this thread and here is the URL it keeps wanting to redirect me too:

http://www.kentuckygolfing.com/?ACT=10

This happens even though the URL I’m specifying to redirect too is “http://www.yahoo.com” as your example demonstrates.

Any ideas on what’s happening here?

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 11 May 2008 02:51 PM   [ Ignore ]   [ # 44 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6579
Joined  04-15-2006

Hmm,

Not good. Just tried it myself on the new version 1.6.3 of ExpressionEngine and indeed it does seem that there is something going on here. I had originally written this for 1.6.1 I think and so there must be something different somewhere due to the upgrades. I will have a look at this if I get any time soon. Pretty busy at the moment though and as I’m not really a coder I’m not entirely certain I will know what is up. Will take a look though but I may have to get some developer support on this one as I’m not really too sure why it would suddenly stop working like that.

Sorry about this. Will take a look as soon as I can.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 May 2008 03:03 PM   [ Ignore ]   [ # 45 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6579
Joined  04-15-2006

Hiya,

Could you possibly give the attached new version of the extension a go and see if this works instead?
New version in post below

Just tested it here on 1.6.3 and seems to be working fine now. If it does work then I will take a better look at where I went wrong with it all.

Let me know how it goes.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 May 2008 03:16 PM   [ Ignore ]   [ # 46 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1570
Joined  08-02-2006

Nope, still no go Mark. I didn’t get the warning messages this time, but the logout redirect still doesn’t work.

Here’s what I’ve got for my redirect:

{exp:logout_redirect url="http://www.kentuckygolfing.com/{segment_1}/{segment_2}/{segment_3}" text="Logout" styles="class='logout-link-class' title='Logout Link'"}

It is still redirecting me to Yahoo’s homepage even though yahoo.com isn’t anywhere to be found in the template code.

Also, I’m not sure if this is by design or not, but when I hover of the link it is still showing “http://www.kentuckygolfing.com/?Act=10” as the URL in the status bar.

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 11 May 2008 04:25 PM   [ Ignore ]   [ # 47 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6579
Joined  04-15-2006

Hi Deron,

Sorry about this. Not too sure what is wrong there then. What version of ExpressionEngine are you running this on?

Also you may need to go and delete the table that the extension has installed to your database because if it isn’t getting removed correctly (although now it should be - perhaps try removing and re-installing the extension a couple of times) then if you had yahoo as the place to re-direct to but that isn’t getting written over in the database then this would cause that kind of behaviour.

So the first thing to try would be disable the extension and re-enable it a couple of times and then try again. If that doesn’t do it then you may need to disable it and then delete the exp_logout_redirect table that was created and then try re-enabling the extension again.

I just tried this on another 2 fresh installs of 1.6.3 and they both worked fine each time so I think there must be something stuck in the piping somewhere.

I was actually thinking of re-making this so that it doesn’t use any database tables actually as the whole thing could be sorted by setting a cookie value and then using that instead. I may look at doing that if I get the time some day soon.

Anyway hope that works for you?

Let me know how it goes.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 11 May 2008 05:53 PM   [ Ignore ]   [ # 48 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1570
Joined  08-02-2006

Version 1.6.3 Mark. Still a no go. I’ve deleted the table in the database and deleted all instances of the ext/plugin from my system folder and re-enabled everything and tried it again and again it takes me to yahoo.com.

So… I guess I’ll let the default logout be for now. I’m not exactly sure that the extension will do what I need anyway so maybe once I get everything else finished on this site I can revisit this problem and see what happens.

Thanks Mark.

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 12 May 2008 04:05 AM   [ Ignore ]   [ # 49 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6579
Joined  04-15-2006

EDIT - New version of extension is attached to the first post in this forum thread

Oops!!!! Please tell me I’m not really THAT stupid am I?!!! grin wink grin

New extension added to the end of this post and I will delete the one above. I had hard-coded Yahoo into the extension whilst I was testing and had forgotten to take it out again afterwards!!!

What an utter plonker!

This version should hopefully work for you wink

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 12 May 2008 05:46 AM   [ Ignore ]   [ # 50 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12416
Joined  04-29-2002

Mark, please make sure you update the plugin link at the top of the thread. It’s become an unwritten law (or best practice) to have the most recent version of a plugin be at the top of the thread so people don’t have to go looking for the right one.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 12 May 2008 06:02 AM   [ Ignore ]   [ # 51 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6579
Joined  04-15-2006

Hi Sue,

I was going to do that but I think that I might add in two versions instead. The reason being that I am not too sure why it suddenly stopped working and as I mentioned before I originally wrote this for a much earlier version of ExpressionEngine and was just following one of the examples from the documentation and so I guess that things have changed a bit since the time when I first made it so was offering up this new version in the hope that it would work although at the moment it seems as though it isn’t working correctly for some reason although I’m not having a problem this end on new installs so I would rather make sure that it is definitely working perfectly before getting rid of the one in the first post if that’s okay?

I do know about the unwritten law actually and always try to do that with my other plugins and add-ons where ever possible so will definitely do that with this one once I have pin-pointed just exactly what is going on with this, or I re-write it to use a cookie instead.

I don’t suppose you would like to test out the latest version of this - two posts above would you Sue and let me know if you have any joy with it? wink

I’m just wondering if it is something on my system that is allowing me to get this working correctly? One other thing Deron - what version of PHP are you running on your site?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 12 May 2008 08:57 AM   [ Ignore ]   [ # 52 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1570
Joined  08-02-2006

Looks like that took care of the problem Mark. Works nice! wink

Thanks

 Signature 

Deron Sizemore
==========
Random Jabber | Sizcons | NiceStylesheet | Kentucky Golfing | LogoGala
Twitter: Deron Sizemore | LogoGala

Profile
 
 
Posted: 12 May 2008 09:17 AM   [ Ignore ]   [ # 53 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6579
Joined  04-15-2006

Hi Deron,

Yep sorry about that. Leaving in test code when you post it as a new version is probably not a good thing to do now is it!! wink

I will delete the one from above and point to the first post where I will update that version. I have also changed the description slightly when you go to your Extensions manager as I did originally have this working from a setting in the Extensions Manager but that meant that you could only ever log out to the one page and this way is much better. You can leave yours as it is though if you’re not bothered by it or just download the extension from the first post (once I have done that!) and upload it over the top of the existing one.

Just out of interest how are you using this on your site then Deron. Always nice to know how people are using these things! wink

Also when I get the chance I think I am going to move this one over to using a cookie instead of using the database. Admittedly it may not work in all cases if people obviously have cookies turned off but I think it might be better in the long run.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 12 May 2008 09:22 AM   [ Ignore ]   [ # 54 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6579
Joined  04-15-2006
Sue Crocker - 12 May 2008 05:46 AM

Mark, please make sure you update the plugin link at the top of the thread. It’s become an unwritten law (or best practice) to have the most recent version of a plugin be at the top of the thread so people don’t have to go looking for the right one.

Hi Sue,

All working and done now wink

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
   
3 of 4
3
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65024 Total Logged-in Users: 40
Total Topics: 82111 Total Anonymous Users: 24
Total Replies: 441282 Total Guests: 189
Total Posts: 523393    
Members ( View Memberlist )