Re: [Dan Maitland] Multiple logi and log out pages
Hi Dan,
Yes, you can use the same approach for the "redirect after logoff" logic. Change your _websiteLogin_logoff function to the following: (changes in red)
// remove login cookies
function _websiteLogin_logoff() {
global $CURRENT_USER;
// remove login cookies
$_SESSION = array();
session_destroy();
// redirect after logoff
if($CURRENT_USER['language']=="french"){
$logoffUrl="/index-fr.php";
}
else{
$logoffUrl="/index.php";
}
// unset current user
$CURRENT_USER = false;
//
redirectBrowserToURL($logoffUrl);
exit;
}
The PROFILE_URL isn't used anywhere inside the Website Membership add-on, it's simply there for organization. When you add a link to a profile page, you'll want to use an IF to decide what the URL should be:
<a href="<?php
if($CURRENT_USER['language']=="french"){
echo "/profile_fr.php";
}
else {
echo "/profile.php";
}
?>">Edit Profile</a>
And you're done!
The LOGIN_FORM_URL, SIGNUP_URL, and REMINDER_URL aren't meant to be used for users who are already logged in — when you don't have a user logged in, you won't be able to use the current user's language field to decide what language to show the user, so you'll probably want to use regular links to let users choose their language.
I hope this helps! Please let me know if you have any questions.
All the best,
Chris