Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: geezmo on September 17, 2006, 09:37:31 AM

Title: How to redirect after logout?
Post by: geezmo on September 17, 2006, 09:37:31 AM
My forum is at www.mainsite.com/forum and I want to implement a code that redirects those who log out of the forum to the main site www.mainsite.com. How can I do this? Thanks.
Title: Re: How to redirect after logout?
Post by: codenaught on September 17, 2006, 11:19:47 AM
Open Sources/LoginOut.php

Find:

// Off to the merry board index we go!
if (empty($_SESSION['logout_url']))
redirectexit('', $context['server']['needs_login_fix']);
else
{
$temp = $_SESSION['logout_url'];
unset($_SESSION['logout_url']);

redirectexit($temp, $context['server']['needs_login_fix']);
}


Change to:

// Off to the merry board index we go!
if (empty($_SESSION['logout_url']))
redirectexit('http://google.com', $context['server']['needs_login_fix']);
else
{
$temp = $_SESSION['logout_url'];
unset($_SESSION['logout_url']);

redirectexit('http://google.com', $context['server']['needs_login_fix']);
}


Changing the http://google.com part to whatever address you want.
Title: Re: How to redirect after logout?
Post by: geezmo on September 17, 2006, 12:06:21 PM
Thanks.. it works!