We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Extension Completed!! - Logout Redirect

Development and Programming

fogcity's avatar
fogcity
260 posts
16 years ago
fogcity's avatar fogcity

Any idea why this works:

{if segment_1 != ""}
{exp:logout_redirect url="http://www.mydomain.com/addons/ee/{segment_1}" text="logout" styles=""}
{if:elseif segment_2 != ""}
{exp:logout_redirect url="http://www.mydomain.com/addons/ee/{segment_1}/{segment_2}" text="logout" styles=""}
{if:elseif segment_3 != ""}
{exp:logout_redirect url="http://www.mydomain.com/addons/ee/{segment_1}/{segment_2}/{segment_3}" text="logout" styles=""}
{/if}

But this doesn’t?

{if segment_2 != ''}
{exp:logout_redirect url="{path={segment_1}/{segment_2}}" text="" styles=""}
{if:elseif segment_1 != ''}
{exp:logout_redirect url="{path={segment_1}}" text="" styles=""}
{/if}

or, better yet, this?

{exp:logout_redirect url="{path={segment_1}{if segment_2}/{segment_2}{/if}}" text="" styles=""}
       
fogcity's avatar
fogcity
260 posts
16 years ago
fogcity's avatar fogcity

strange error when loading a page with logout redirect (only happens in IE):

MySQL ERROR:

Error Number: 1062

Description: Duplicate entry '1' for key 1

Query: INSERT INTO exp_logout_redirect_url SET member_id = '1', redirect_url = 'http://mysite.com/addons/ee/blog/categories/category/'

any clue what’s happening?

       
fogcity's avatar
fogcity
260 posts
16 years ago
fogcity's avatar fogcity

Note that if I log in as the same user on two machines, I tend to see a “Duplicate Query” error, attributed to the Logout Redirect plugin.

Seems like the query needs to be smarter about considering IP address as well as userid to avoid such conflicts?

       
fogcity's avatar
fogcity
260 posts
16 years ago
fogcity's avatar fogcity

more detail on bug reported previously:

below is the error that is generated

MySQL ERROR:

Error Number: 1062

Description: Duplicate entry '1' for key 1

Query: INSERT INTO exp_logout_redirect_url SET member_id = '1', redirect_url = 'http://mydomain.com/mypath/'

anyone else seeing this? hello?

       
Todd D.'s avatar
Todd D.
460 posts
16 years ago
Todd D.'s avatar Todd D.

I can verify that this plugin does work with 1.6.7 just fine. No problems whatsoever.

Thanks Mark for helping me out in a pinch. :cheese:

       
xqzzzme's avatar
xqzzzme
63 posts
about 16 years ago
xqzzzme's avatar xqzzzme

Can’t see what I’m doing wrong. I want to redirect back to the page that the person logged out of and {segment_X} doesn’t work. Here is the code, basically straight from the Forum Module Top Bar plus logout-redirect. I do have the Forum running through EE template, so tags are working and the logout-redirect works, but not with the segment. Platform is always segment_1. Here is the URL it returns: http://domain.com/platform/{segment_2}

{if logged_in}
    <table border="0" cellspacing="0" cellpadding="0" align="right">
<tr>
    <td><span>{lang:logged_in_as}<b>{screen_name}</b></span></td>
    <td>{exp:logout_redirect url="http://domain.com/platform/{segment_2}" text="LOG OUT" styles="class='logout-link-class' title='Logout Link'"}</td>
       
vibe9's avatar
vibe9
96 posts
15 years ago
vibe9's avatar vibe9

I am having the same issue as @xqzzzme, running EE 1.6.8. The {segment_x} variable is ignored and furthermore, even if I hardcode a url, when I click the logout link it goes to http://www.mysite.com/?ACT=10 and then if I navigate back to the page I am still logged in?!?!

       
Interfacer's avatar
Interfacer
92 posts
15 years ago
Interfacer's avatar Interfacer

Hi Mark thanks for the great plugin.

Is it possible to have two tag pairs of your extension in the same template with both log outs redirecting to two different places? I have tried it but it seems that the first one loading is over-writing the url of the second logout.

thanks heaps

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
15 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Unfortunately I’m not really actively supporting this add-on any more as there are other add-ons which work a bit better than this one. Admitted I’ve not seen one that can log you out and redirect to multiple places although from what I’m thinking on this one I don’t think that will be possible as what happens is the plugin writes a URL (the URL you want to redirect to) to a database table for each user. This is then used upon logging out. What is happening in this instance is that the first URL gets set in the database table but then as soon as the next plugin call is placed on the page that is overwritten.

As there can only ever be one value in the database at one time then this isn’t going to be able to work in its current incarnation. The only way I could see this working would be to have some sort of session variable set with each plugin call and then upon clicking the link that link would have to have something extra in it to tell the system which link was clicked and thus which session variable to use to log out to.

Unfortunately as I said I’m not really actively pursuing this add-on any more due to time constraints and needing to get paid client work out of the way first but if I do come up with any mind-blowing ideas on this I will definitely think about re-visiting it at some point.

Sorry not to be able to help on this right away but at its current state you are quite right that the second plugin call is overwriting the first plugin call and so this behavior will always take place at the moment. I promise I will have a think about this though.

Best wishes,

Mark

       
Shane Avery's avatar
Shane Avery
5 posts
15 years ago
Shane Avery's avatar Shane Avery

Mark,

Thank you for this handy plugin.

Interfacer,

Just to let you know, I was able to achieve the same results as having 2 tag pairs on one template (at least for my needs) by using conditionals and an embed. Like so:

Master Template:

{if logged_in}

{if member_group == "17"}
{embed="ai_profiles/associate_logout"}
{/if}

{if member_group != "17"}
{exp:user:stats}
{exp:logout_redirect url="{public_profile_url}" text="Logout" styles="title='Logout' class='logout_link'"}
{/exp:user:stats}
{/if}

{/if}

Embedded Template:

{exp:logout_redirect url="http://www.obxguides.com/ai_profiles/login/17/" text="Logout" styles="title='Logout' class='logout_link'"}

Hope that helps…

       
James Likeness's avatar
James Likeness
10 posts
15 years ago
James Likeness's avatar James Likeness

I’m having extra trailing /’s when I try to use {segment_X} tags, like others on here. Mark, you mentioned that there are other add-ons which work a bit better than this one. Can you point me to one of those, as you’re not really actively supporting this add-on anymore? I would just like to send my users back to the page they came from when logging out, without any trailing /’s.

Thanks!

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
15 years ago
Mark Bowen's avatar Mark Bowen

Hi James,

If memory serves me right then the Twomile Redirect After Login extension would be your best bet here I think.

Best wishes,

Mark

       
Sjoerd's avatar
Sjoerd
233 posts
15 years ago
Sjoerd's avatar Sjoerd

Hi Mark,

Could you make it work for EE2? That would be very nice! Look at this post

       
First 3 4 5

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.