diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index dd449bda420..ce9e36b83ce 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -354,7 +354,7 @@ if (! defined('NOLOGIN')) exit; } - // If requested by the login has already occurred, it is retrieved from the session + // If login request was already post, we retrieve login from the session // Call module if not realized that his request. // At the end of this phase, the variable $login is defined. $resultFetchUser=''; @@ -516,7 +516,7 @@ if (! defined('NOLOGIN')) exit; } - $resultFetchUser=$user->fetch('', $login, '', 0, ($entitytotest ? $entitytotest : -1)); + $resultFetchUser=$user->fetch('', $login, '', 1, ($entitytotest ? $entitytotest : -1)); if ($resultFetchUser <= 0) { dol_syslog('User not found, connexion refused'); @@ -692,10 +692,12 @@ if (! defined('NOLOGIN')) { $db->commit(); } - - if (! empty($conf->global->MAIN_LANDING_PAGE)) // Example: /index.php + + // Change landing page if defined. + $landingpage=(empty($user->conf->MAIN_LANDING_PAGE)?(empty($conf->global->MAIN_LANDING_PAGE)?'':$conf->global->MAIN_LANDING_PAGE):$user->conf->MAIN_LANDING_PAGE); + if (! empty($landingpage)) // Example: /index.php { - $newpath=dol_buildpath($conf->global->MAIN_LANDING_PAGE, 1); + $newpath=dol_buildpath($landingpage, 1); if ($_SERVER["PHP_SELF"] != $newpath) // not already on landing page (avoid infinite loop) { header('Location: '.$newpath); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 7307590016a..51aefa8d4de 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -156,7 +156,7 @@ class User extends CommonObject * @param int $id Si defini, id a utiliser pour recherche * @param string $login Si defini, login a utiliser pour recherche * @param string $sid Si defini, sid a utiliser pour recherche - * @param int $loadpersonalconf Also load personal conf of user (in $user->conf->xxx) + * @param int $loadpersonalconf 1=also load personal conf of user (in $user->conf->xxx) * @param int $entity If a value is >= 0, we force the search on a specific entity. If -1, means search depens on default setup. * @return int <0 if KO, 0 not found, >0 if OK */