hi,
1st step:
I add field on user table: AppLang
2nd step:
Added this code in: Server Events > Global Codes
function AppLanguage() {
$applang = ExecuteScalar("SELECT AppLang FROM employees");
return $applang;
}
3th step:
Added this code in: Other > Login Page > User LoggedIn
function User_LoggedIn($usr)
{
//Log("User Logged In");
if AppLanguage() == "1") { // french language value
$_SESSION[SESSION_LANGUAGE_ID] = "fr-FR";
}
else {
$_SESSION[SESSION_LANGUAGE_ID] = "en-US";
}
}
It doesn't work this way.
I can only change the language on a per-user basis with the CurrentUserID() value. When the user logs into the application, I want him to have the default language that I defined in the user table. I can't find where I went wrong.