diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 04c8fa9ca6b78..3bf545422ec26 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -567,7 +567,7 @@ function analyse_sql_and_script(&$var, $type) } // Create entity cookie, just used for login page - if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && !empty($conf->global->MAIN_MULTICOMPANY_COOKIE) && isset($_POST["entity"])) + if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_COOKIE_ENABLED) && isset($_POST["entity"])) { include_once(DOL_DOCUMENT_ROOT."/core/class/cookie.class.php"); @@ -576,7 +576,7 @@ function analyse_sql_and_script(&$var, $type) $prefix=dol_getprefix(); $entityCookieName = 'DOLENTITYID_'.$prefix; // TTL : is defined in the config page multicompany - $ttl = (! empty($conf->global->MAIN_MULTICOMPANY_COOKIE_TTL) ? $conf->global->MAIN_MULTICOMPANY_COOKIE_TTL : time()+60*60*8 ); + $ttl = (! empty($conf->global->MULTICOMPANY_COOKIE_TTL) ? $conf->global->MULTICOMPANY_COOKIE_TTL : time()+60*60*8 ); // Cryptkey : will be created randomly in the config page multicompany $cryptkey = (! empty($conf->file->cookie_cryptkey) ? $conf->file->cookie_cryptkey : '' ); diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index b36d3316cb0d8..2e351983167cc 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -137,7 +137,7 @@ { $conf->entity = GETPOST("entity",'int'); } - else // TODO Does this "else" still usefull ? + else { $prefix=dol_getprefix(); $entityCookieName = 'DOLENTITYID_'.$prefix;