Clean code
This commit is contained in:
parent
f0f81cd2cd
commit
9e6f782907
@ -167,7 +167,7 @@ class Events // extends CommonObject
|
||||
$sql .= " '".$this->db->escape(getUserRemoteIP())."',";
|
||||
$sql .= " ".($this->user_agent ? "'".$this->db->escape(dol_trunc($this->user_agent, 250))."'" : 'NULL').",";
|
||||
$sql .= " '".$this->db->idate($this->dateevent)."',";
|
||||
$sql .= " ".($user->id ? "'".$this->db->escape($user->id)."'" : 'NULL').",";
|
||||
$sql .= " ".($user->id > 0 ? ((int) $user->id) : 'NULL').",";
|
||||
$sql .= " '".$this->db->escape(dol_trunc($this->description, 250))."',";
|
||||
$sql .= " '".$this->db->escape(dol_getprefix())."'";
|
||||
$sql .= ")";
|
||||
|
||||
@ -187,7 +187,8 @@ if (!function_exists('dol_loginfunction')) {
|
||||
$template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";
|
||||
}
|
||||
|
||||
// Set cookie for timeout management
|
||||
// Set cookie for timeout management. We set it as a cookie so we will be able to use it to set timeout on next page before the session start
|
||||
// and the conf file is loaded.
|
||||
$prefix = dol_getprefix('');
|
||||
$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
|
||||
if (!empty($conf->global->MAIN_SESSION_TIMEOUT)) {
|
||||
|
||||
@ -282,7 +282,7 @@ if (!empty($php_session_save_handler) && $php_session_save_handler == 'db') {
|
||||
|
||||
// Init session. Name of session is specific to Dolibarr instance.
|
||||
// Must be done after the include of filefunc.inc.php so global variables of conf file are defined (like $dolibarr_main_instance_unique_id or $dolibarr_main_force_https).
|
||||
// Note: the function dol_getprefix is defined into functions.lib.php but may have been defined to return a different key to manage another area to protect.
|
||||
// Note: the function dol_getprefix() is defined into functions.lib.php but may have been defined to return a different key to manage another area to protect.
|
||||
$prefix = dol_getprefix('');
|
||||
$sessionname = 'DOLSESSID_'.$prefix;
|
||||
$sessiontimeout = 'DOLSESSTIMEOUT_'.$prefix;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user