Fix warning

This commit is contained in:
Laurent Destailleur 2022-12-02 16:34:56 +01:00
parent 164fa1255d
commit 48f7d20e83
2 changed files with 19 additions and 16 deletions

View File

@ -2345,7 +2345,8 @@ if ($id > 0) {
if (isModEnabled("societe")) { if (isModEnabled("societe")) {
// Related company // Related company
print '<tr><td class="titlefield">'.$langs->trans("ActionOnCompany").'</td><td>'.($object->thirdparty->id ? $object->thirdparty->getNomUrl(1) : ('<span class="opacitymedium">'.$langs->trans("None").'</span>')); print '<tr><td class="titlefield">'.$langs->trans("ActionOnCompany").'</td>';
print '<td>'.(is_object($object->thirdparty) && $object->thirdparty->id ? $object->thirdparty->getNomUrl(1) : ('<span class="opacitymedium">'.$langs->trans("None").'</span>'));
if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL') { if (is_object($object->thirdparty) && $object->thirdparty->id > 0 && $object->type_code == 'AC_TEL') {
if ($object->thirdparty->fetch($object->thirdparty->id)) { if ($object->thirdparty->fetch($object->thirdparty->id)) {
print "<br>".dol_print_phone($object->thirdparty->phone); print "<br>".dol_print_phone($object->thirdparty->phone);

View File

@ -193,22 +193,24 @@ if (!function_exists('dol_loginfunction')) {
$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix; $sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
if (!empty($conf->global->MAIN_SESSION_TIMEOUT)) { if (!empty($conf->global->MAIN_SESSION_TIMEOUT)) {
if (PHP_VERSION_ID < 70300) { if (session_status() != PHP_SESSION_ACTIVE) {
session_set_cookie_params(0, '/', null, ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start. if (PHP_VERSION_ID < 70300) {
} else { session_set_cookie_params(0, '/', null, ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
// Only available for php >= 7.3 } else {
$sessioncookieparams = array( // Only available for php >= 7.3
'lifetime' => 0, $sessioncookieparams = array(
'path' => '/', 'lifetime' => 0,
//'domain' => '.mywebsite.com', // the dot at the beginning allows compatibility with subdomains 'path' => '/',
'secure' => ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true), //'domain' => '.mywebsite.com', // the dot at the beginning allows compatibility with subdomains
'httponly' => true, 'secure' => ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true),
'samesite' => 'Lax' // None || Lax || Strict 'httponly' => true,
); 'samesite' => 'Lax' // None || Lax || Strict
session_set_cookie_params($sessioncookieparams); );
} session_set_cookie_params($sessioncookieparams);
}
setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", null, (empty($dolibarr_main_force_https) ? false : true), true); setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", null, (empty($dolibarr_main_force_https) ? false : true), true);
}
} }
if (GETPOST('urlfrom', 'alpha')) { if (GETPOST('urlfrom', 'alpha')) {