2
0
forked from Wavyzz/dolibarr

Perf. Do not load personal conf of user by default.

This commit is contained in:
Laurent Destailleur
2017-04-14 12:52:32 +02:00
parent 4818b1ba44
commit aabfc2f0db
3 changed files with 16 additions and 9 deletions

View File

@@ -522,7 +522,7 @@ if (! defined('NOLOGIN'))
exit;
}
$resultFetchUser=$user->fetch('', $login, '', 1, ($entitytotest ? $entitytotest : -1));
$resultFetchUser=$user->fetch('', $login, '', 1, ($entitytotest > 0 ? $entitytotest : -1));
if ($resultFetchUser <= 0)
{
dol_syslog('User not found, connexion refused');
@@ -579,7 +579,7 @@ if (! defined('NOLOGIN'))
$entity=$_SESSION["dol_entity"];
dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG);
$resultFetchUser=$user->fetch('',$login,'',1,($entity > 0 ? $entity : -1));
$resultFetchUser=$user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1));
if ($resultFetchUser <= 0)
{
// Account has been removed after login
@@ -734,11 +734,11 @@ if (! defined('NOLOGIN'))
}
/*
* Overwrite configs global by personal configs (Note: Some conf->global personal vars were overwrote by the user->fetch)
* Overwrite some configs globals (try to avoid this and have code to use instead $user->conf->xxx)
*/
// Set liste_limit
if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) $conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT; // Can be 0
if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) $conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT; // Can be 0
if (isset($user->conf->PRODUIT_LIMIT_SIZE)) $conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE; // Can be 0
// Replace conf->css by personalized value if theme not forced