Merge pull request #14772 from aspangaro/10.0p50

FIX Yogosha report 4465 (backport)
This commit is contained in:
Laurent Destailleur 2020-09-23 19:57:29 +02:00 committed by GitHub
commit 8e69574dee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,8 +131,8 @@ if (! function_exists('dol_loginfunction'))
*/
function dol_loginfunction($langs, $conf, $mysoc)
{
global $dolibarr_main_demo, $db;
global $hookmanager;
global $dolibarr_main_demo, $dolibarr_main_force_https;
global $db, $hookmanager;
$langs->loadLangs(array("main","other","help","admin"));
@ -187,7 +187,7 @@ if (! function_exists('dol_loginfunction'))
// Set cookie for timeout management
$prefix=dol_getprefix('');
$sessiontimeout='DOLSESSTIMEOUT_'.$prefix;
if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", null, false, true);
if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", null, (empty($dolibarr_main_force_https) ? false : true), true);
if (GETPOST('urlfrom', 'alpha')) $_SESSION["urlfrom"]=GETPOST('urlfrom', 'alpha');
else unset($_SESSION["urlfrom"]);