FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » want to logout and leave forum with one click
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
want to logout and leave forum with one click [message #8408] Mon, 27 January 2003 16:54 Go to next message
kowitsch is currently offline  kowitsch   Germany
Messages: 10
Registered: January 2003
Location: Germany
Karma: 0
Junior Member
Hello FUD community,

I am looking for a way to logout and jump to another page outside the forum with the same click.
I thought I could use the "returnto" variable for that, but for whatever reason it didn't work. Logout works fine by submitting:
&logout=1
in a link in my header-template, but redirecting seems to be ignored:
<a href="{ROOT}?t=login&amp;{DEF: _rsid}&amp;returnto=%2Findex.html&amp;logout=1">leave forum</a>

Do I miss something.
I didn't find explaination on the "returnto" var here at the support forum.

Thank you very much in advance

Kowitsch
Re: want to logout and leave forum with one click [message #8410 is a reply to message #8408] Mon, 27 January 2003 18:49 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
returnto contains the URL where the user should be redirected once the form is executed.

FUDforum Core Developer
Re: want to logout and leave forum with one click [message #8413 is a reply to message #8408] Mon, 27 January 2003 19:54 Go to previous messageGo to next message
kowitsch is currently offline  kowitsch   Germany
Messages: 10
Registered: January 2003
Location: Germany
Karma: 0
Junior Member
Hello Prottoss,

you are super fast in answering - thank you.

I just tried the above at home on my test server (W2K/Apache/PHP/MySQL/Perl). The following line works fine
http://myserver/forum/index.php?t=login&rid=1&S=ffc73dad92d5bb605ba ed62dda4ecaeb&returnto=%2Findex.html%3Ft%3Dindex%26rid%3D%26S%3Dffc73da d92d5bb605baed62dda4ecaeb&logout=1

and calls file /index.html which directs to my apache root as desired.

The "real" web-server is based on Linux/PHP/MySQL/Perl. It correctly logs out, but always returns to the forum/index.php file.
Why could this difference be?

Kind regards

Kowitsch

[Updated on: Mon, 27 January 2003 19:58]

Report message to a moderator

Re: want to logout and leave forum with one click [message #8414 is a reply to message #8413] Mon, 27 January 2003 20:39 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The return to code can be found inside
return.inc.t, specifically the check_return() function.

It works by breaking up the passed URL and passing it to index.php which then loads an appropriate page.

In your case the solution is to create a simple PHP script and place it in the forum directory.

That script will redirect the user to any URL you desire and then call exit().


FUDforum Core Developer
Re: want to logout and leave forum with one click [message #8422 is a reply to message #8408] Tue, 28 January 2003 01:22 Go to previous messageGo to next message
kowitsch is currently offline  kowitsch   Germany
Messages: 10
Registered: January 2003
Location: Germany
Karma: 0
Junior Member
Hello Prottoss,
it took me the whole evening to figure out what you had in mind. Some people are slower than others.
But after all, it works now.

Did you mean a solution like this (for other users as slow as me)?

I made a file myredir.php with a fixed redir-value
<?php
header("Location: http://myserver");
exit();
?>

placed it in "/forum/theme/default"

and called it via
<a href="{ROOT}?t=login&amp;{DEF: _rsid}&amp;returnto={ROOT}?t=myredir&amp;logout=1">back to homepage</a>

which I inserted in my header template.

Question:
What happens to myredir.php and the modified header template, if I upgrade FUD?

P.S. I realized why my home server did the logout+redir the way I described in my first post and the "real" server didn't.
The home server had v2.2.3 of fud. The "real" server had v2.3.6. When I updated my home server, my redirection method didn't work as well. The check_return() function you mentioned has been completely rewritten since then. Now all "returnto" calls go via index.php?t=abc... instead of direct calls as in v2.2.3. Suppose, this was for security reasons.

Thank you Prottoss
Re: want to logout and leave forum with one click [message #8423 is a reply to message #8422] Tue, 28 January 2003 01:30 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
your PHP script will never be touched unless for some reason a forum script under the same name is created. The modified header.tmpl will also remain untouched unless the source template is modified which very rarely happens.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: help "i need the forum to be right to left"?????
Next Topic: Password for autocreated users.
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 16:29:51 GMT 2024

Total time taken to generate the page: 0.02391 seconds