Fix: Default language on login page

This commit is contained in:
Laurent Destailleur 2010-04-13 21:56:06 +00:00
parent 9df4f1ad7e
commit b33b1c56b8
3 changed files with 7 additions and 7 deletions

View File

@ -26,6 +26,7 @@ For users:
- Fix: Can change password if has only permission change password. - Fix: Can change password if has only permission change password.
- Fix: Project PDF document show the tasks. - Fix: Project PDF document show the tasks.
- Fix: bug #29278 : SMTP fails with IP - Fix: bug #29278 : SMTP fails with IP
- Fix: Default language on login page.
For developers: For developers:
- More comments in code. - More comments in code.

View File

@ -35,7 +35,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
{ {
global $dolibarr_main_demo,$db; global $dolibarr_main_demo,$db;
$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]); $langcode=(empty($_GET["lang"])?((is_object($langs)&&$langs->defaultlang)?$langs->defaultlang:'auto'):$_GET["lang"]);
$langs->setDefaultLang($langcode); $langs->setDefaultLang($langcode);
$langs->load("main"); $langs->load("main");
@ -44,7 +44,7 @@ function dol_loginfunction($langs,$conf,$mysoc)
$main_authentication=$conf->file->main_authentication; $main_authentication=$conf->file->main_authentication;
$session_name=session_name(); $session_name=session_name();
$dol_url_root = DOL_URL_ROOT; $dol_url_root = DOL_URL_ROOT;
$php_self = $_SERVER['PHP_SELF']; $php_self = $_SERVER['PHP_SELF'];
@ -204,9 +204,9 @@ function dol_loginfunction($langs,$conf,$mysoc)
} }
} }
$main_home=nl2br($conf->global->MAIN_HOME); $main_home=nl2br($conf->global->MAIN_HOME);
$dol_loginmesg = $_SESSION["dol_loginmesg"]; $dol_loginmesg = $_SESSION["dol_loginmesg"];
include($template_dir.'login.tpl.php'); // To use native PHP include($template_dir.'login.tpl.php'); // To use native PHP
$_SESSION["dol_loginmesg"] = ''; $_SESSION["dol_loginmesg"] = '';

View File

@ -338,7 +338,7 @@ if (! defined('NOLOGIN'))
// Validation tests user / password // Validation tests user / password
// If ok, the variable will be initialized login // If ok, the variable will be initialized login
// If error, we will put error message in session under the name dol_loginmesg $goontestloop=false; // If error, we will put error message in session under the name dol_loginmesg
$goontestloop=false; $goontestloop=false;
if (isset($_SERVER["REMOTE_USER"]) && in_array('http',$authmode)) $goontestloop=true; if (isset($_SERVER["REMOTE_USER"]) && in_array('http',$authmode)) $goontestloop=true;
if (isset($_POST["username"])) $goontestloop=true; if (isset($_POST["username"])) $goontestloop=true;
@ -438,8 +438,7 @@ if (! defined('NOLOGIN'))
} }
else else
{ {
// It is already in a backup session login // It is already in a session
// Remarks: We do not save user object poses for bp in some cases misidentified
$login=$_SESSION["dol_login"]; $login=$_SESSION["dol_login"];
$resultFetchUser=$user->fetch($login); $resultFetchUser=$user->fetch($login);
dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login); dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login);