Re: [Dan Maitland] Multiple logi and log out pages
Hi,
What you need to do is to customize the webisteMembership plugin code where it redirects after login.
In the login function you'll find this code:
// redirect on success
if (@$_SESSION['lastUrl']) { $postLoginUrl = @$_SESSION['lastUrl']; }
else if ($GLOBALS['WEBSITE_LOGIN_POST_LOGIN_URL']) { $postLoginUrl = $GLOBALS['WEBSITE_LOGIN_POST_LOGIN_URL']; }
else { $postLoginUrl = thisPageUrl(); }
$redirectUrl = $GLOBALS['WEBSITE_LOGIN_POST_LOGIN_URL'];
unset($_SESSION['lastUrl']);
redirectBrowserToURL("$postLoginUrl");
exit;
You'll need to change this to look for a value in the $CURRENT_USER variable. This variable contains all the fields inside the accounts table.
You can change it to look something like this:
(NOTE: This is only an example. You'll need to customize this to fit your needs and field names)
// redirect on success
if (@$_SESSION['lastUrl']) { $postLoginUrl = @$_SESSION['lastUrl']; }
else if ($GLOBALS['WEBSITE_LOGIN_POST_LOGIN_URL']) {
if($CURRENT_USER['language']=="french"){
$postLoginUrl="frenchIndex.php";
}
else{
$postLoginUrl="englishIndex.php";
}
}
else { $postLoginUrl = thisPageUrl(); }
$redirectUrl = $GLOBALS['WEBSITE_LOGIN_POST_LOGIN_URL'];
unset($_SESSION['lastUrl']);
redirectBrowserToURL("$postLoginUrl");
exit;
Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/