From 80ca284557d7f77c83d75973db81a75fdc195c76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Oct 2008 11:41:13 +0000 Subject: [PATCH] New: Can set session timeout. --- htdocs/admin/agenda.php | 2 +- htdocs/admin/events.php | 12 +- htdocs/admin/security_other.php | 37 +++++- htdocs/admin/system/dolibarr.php | 94 ++------------ htdocs/admin/system/modules.php | 121 ++++++++++++++++++ htdocs/admin/system/pre.inc.php | 16 +-- htdocs/admin/triggers.php | 10 +- .../menus/barre_left/eldy_backoffice.php | 1 + .../menus/barre_left/eldy_frontoffice.php | 1 + htdocs/langs/en_US/admin.lang | 6 +- htdocs/langs/fr_FR/admin.lang | 4 + htdocs/lib/antispamimage.php | 1 + htdocs/main.inc.php | 4 +- htdocs/user/logout.php | 5 + htdocs/user/param_ihm.php | 10 +- htdocs/user/passwordforgotten.php | 3 +- 16 files changed, 207 insertions(+), 120 deletions(-) create mode 100644 htdocs/admin/system/modules.php diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index f7dfaa323fc..ea3cdd86bbf 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -117,7 +117,7 @@ foreach ($eventstolog as $key => $arr) print ''; $key='MAIN_AGENDA_ACTIONAUTO_'.$arr['id']; $value=$conf->global->$key; - print ''; + print ''; print ''."\n"; } } diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index b1521ceaca6..15f1f6abdeb 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -17,11 +17,11 @@ */ /** - \file htdocs/admin/events.php - \ingroup core - \brief Log event setup page - \version $Id$ -*/ + * \file htdocs/admin/events.php + * \ingroup core + * \brief Log event setup page + * \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); @@ -133,7 +133,7 @@ foreach ($eventstolog as $key => $arr) print ''; $key='MAIN_LOGEVENTS_'.$arr['id']; $value=$conf->global->$key; - print ''; + print ''; print ''."\n"; } } diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 6a8e66c6cd6..b4f5d9d77df 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -17,11 +17,11 @@ */ /** - \file htdocs/admin/security_other.php - \ingroup core - \brief Page de configuration du module s�curit� autre - \version $Id$ -*/ + * \file htdocs/admin/security_other.php + * \ingroup core + * \brief Page de configuration du module s�curit� autre + * \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); @@ -62,6 +62,13 @@ else if ($_GET["action"] == 'disable_captcha') exit; } +if ($_GET["action"] == 'MAIN_SESSION_TIMEOUT') +{ + dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"]); + Header("Location: security_other.php"); + exit; +} + if ($_GET["action"] == 'activate_avscan') { dolibarr_set_const($db, "MAIN_USE_AVSCAN", '1'); @@ -99,7 +106,7 @@ $form = new Form($db); print ''; print ''; -print ''; +print ''; print ''; print ''; print "\n"; @@ -107,7 +114,7 @@ print "\n"; print ''; print ''; -print ''; print ''; + +$var=!$var; +if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT=ini_get("session.gc_maxlifetime"); +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + print '
'.$langs->trans("Parameter").''.$langs->trans("Parameter").''.$langs->trans("Value").' 
'.$langs->trans("MaxSizeForUploadedFiles").'.'; +print ''.$langs->trans("MaxSizeForUploadedFiles").'.'; $max=@ini_get('upload_max_filesize'); if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit",$max*1024,$langs->trans("Kb")).'.'; else print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.'; @@ -119,6 +126,22 @@ print ''; print ''; print '
'.$langs->trans("SessionTimeOut").''; +print $form->textwithhelp('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); +print ''; +print ' '.$langs->trans("seconds"); +print ''; +print ''; +print '
'; print '
'; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 606f467ac9f..16ffaf0598f 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -36,6 +36,8 @@ if (!$user->admin) /* * View */ + +$form=new Form($db); llxHeader(); @@ -100,94 +102,24 @@ print '
'; $var=true; print ''; -print ''."\n"; +print ''."\n"; $var=!$var; -print "\n"; -//$var=!$var; -//print "\n"; +print "\n"; $var=!$var; -print "\n"; +print "\n"; $var=!$var; -print "\n"; +print "\n"; $var=!$var; -print "\n"; +print "\n"; $var=!$var; -print "\n"; +print "\n"; +$var=!$var; +print "\n"; print '
'.$langs->trans("Session").''.$langs->trans("Value").'
'.$langs->trans("Session").''.$langs->trans("Value").'
".$langs->trans("SessionId")."".session_id()."
".$langs->trans("CurrentSessionTimeOut")."".ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds")."
".$langs->trans("SessionId").''.session_id()."
".$langs->trans("CurrentTheme")."".$conf->theme."
".$langs->trans("CurrentSessionTimeOut").''.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); +print ''; +print $form->textwithhelp('',$langs->trans("SessionExplanation",ini_get("session.gc_probability"),ini_get("session.gc_divisor"))); +print "
".$langs->trans("CurrentTopMenuHandler")."".$conf->top_menu."
".$langs->trans("CurrentTheme").''.$conf->theme."
".$langs->trans("CurrentLeftMenuHandler")."".$conf->left_menu."
".$langs->trans("CurrentTopMenuHandler").''.$conf->top_menu."
".$langs->trans("CurrentUserLanguage")."".$langs->getDefaultLang()."
".$langs->trans("CurrentLeftMenuHandler").''.$conf->left_menu."
".$langs->trans("CurrentUserLanguage").''.$langs->getDefaultLang()."
'; print '
'; - -// Charge les modules -$db->begin(); - -$dir = DOL_DOCUMENT_ROOT . "/includes/modules/"; -$handle=opendir($dir); -$modules = array(); -$modules_names = array(); -$modules_files = array(); -while (($file = readdir($handle))!==false) -{ - if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php') - { - $modName = substr($file, 0, strlen($file) - 10); - - if ($modName) - { - include_once(DOL_DOCUMENT_ROOT."/includes/modules/".$file); - $objMod = new $modName($db); - - $modules[$objMod->numero]=$objMod; - $modules_names[$objMod->numero]=$objMod->name; - $modules_files[$objMod->numero]=$file; - $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; - } - } -} -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -$var=false; -$sortorder=$modules_names; -ksort($sortorder); -$rights_ids = array(); -foreach($sortorder as $numero=>$name) -{ - $idperms=""; - $var=!$var; - // Module - print ""; - // Version - print ''; - // Id - print ''; - // Permissions - if ($modules[$numero]->rights) - { - foreach($modules[$numero]->rights as $rights) - { - $idperms.=($idperms?", ":"").$rights[0]; - array_push($rights_ids, $rights[0]); - } - } - print ''; - print "\n"; -} -print '
'.$langs->trans("Modules").''.$langs->trans("Version").''.$langs->trans("Id Module").''.$langs->trans("Id Permissions").'
"; - $alt=$name.' - '.$modules_files[$numero]; - print img_object($alt,$picto[$numero]).' '.$modules[$numero]->getName(); - print "'.$modules[$numero]->getVersion().''.$numero.''.($idperms?$idperms:" ").'
'; -print '
'; -sort($rights_ids); -foreach($rights_ids as $right_id) -{ - if ($old == $right_id) - print "Attention doublon sur la permission : $right_id
"; - $old = $right_id; -} - llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php new file mode 100644 index 00000000000..1daddf96cfd --- /dev/null +++ b/htdocs/admin/system/modules.php @@ -0,0 +1,121 @@ + + * Copyright (C) 2007 Rodolphe Quiedeville + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * \file htdocs/admin/system/dolibarr.php + * \brief Fichier page info systemes Dolibarr + * \version $Id$ + */ + +require("./pre.inc.php"); + +$langs->load("admin"); +$langs->load("install"); +$langs->load("other"); + +if (!$user->admin) + accessforbidden(); + + +/* + * View + */ + +llxHeader(); + +print_fiche_titre($langs->trans("AvailableModules"),'','setup'); + +print "
\n"; +print $langs->trans("ToActivateModule").'
'; +print "
\n"; + +// Charge les modules +$db->begin(); + +$dir = DOL_DOCUMENT_ROOT . "/includes/modules/"; +$handle=opendir($dir); +$modules = array(); +$modules_names = array(); +$modules_files = array(); +while (($file = readdir($handle))!==false) +{ + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, strlen($file) - 10) == '.class.php') + { + $modName = substr($file, 0, strlen($file) - 10); + + if ($modName) + { + include_once(DOL_DOCUMENT_ROOT."/includes/modules/".$file); + $objMod = new $modName($db); + + $modules[$objMod->numero]=$objMod; + $modules_names[$objMod->numero]=$objMod->name; + $modules_files[$objMod->numero]=$file; + $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; + } + } +} +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +$var=false; +$sortorder=$modules_names; +ksort($sortorder); +$rights_ids = array(); +foreach($sortorder as $numero=>$name) +{ + $idperms=""; + $var=!$var; + // Module + print ""; + // Version + print ''; + // Id + print ''; + // Permissions + if ($modules[$numero]->rights) + { + foreach($modules[$numero]->rights as $rights) + { + $idperms.=($idperms?", ":"").$rights[0]; + array_push($rights_ids, $rights[0]); + } + } + print ''; + print "\n"; +} +print '
'.$langs->trans("Modules").''.$langs->trans("Version").''.$langs->trans("Id Module").''.$langs->trans("Id Permissions").'
"; + $alt=$name.' - '.$modules_files[$numero]; + print img_object($alt,$picto[$numero]).' '.$modules[$numero]->getName(); + print "'.$modules[$numero]->getVersion().''.$numero.''.($idperms?$idperms:" ").'
'; +print '
'; +sort($rights_ids); +foreach($rights_ids as $right_id) +{ + if ($old == $right_id) + print "Attention doublon sur la permission : $right_id
"; + $old = $right_id; +} + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/admin/system/pre.inc.php b/htdocs/admin/system/pre.inc.php index 528266c4c48..6f987064d84 100644 --- a/htdocs/admin/system/pre.inc.php +++ b/htdocs/admin/system/pre.inc.php @@ -17,15 +17,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** - \file htdocs/admin/system/pre.inc.php - \brief Fichier gestionnaire menu page infos système - \version $Revision$ -*/ + * \file htdocs/admin/system/pre.inc.php + * \brief Fichier gestionnaire menu page infos système + * \version $Id$ + */ require("../../main.inc.php"); @@ -45,7 +43,8 @@ function llxHeader($head = "", $urlp = "") // Dolibarr $menu->add(DOL_URL_ROOT."/admin/system/dolibarr.php", "Dolibarr"); $menu->add_submenu(DOL_URL_ROOT."/admin/system/constall.php", $langs->trans("AllParameters")); - $menu->add_submenu(DOL_URL_ROOT."/admin/triggers.php", $langs->trans("Triggers")); + $menu->add_submenu(DOL_URL_ROOT."/admin/system/modules.php", $langs->trans("Modules")); + $menu->add_submenu(DOL_URL_ROOT."/admin/triggers.php", $langs->trans("Triggers")); $menu->add_submenu(DOL_URL_ROOT."/about.php", $langs->trans("About")); // OS @@ -56,9 +55,6 @@ function llxHeader($head = "", $urlp = "") // PHP $menu->add(DOL_URL_ROOT."/admin/system/phpinfo.php", $langs->trans("Php")); - $menu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php?what=conf", $langs->trans("PhpConf")); - $menu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php?what=env", $langs->trans("PhpEnv")); - $menu->add_submenu(DOL_URL_ROOT."/admin/system/phpinfo.php?what=modules", $langs->trans("PhpModules")); // Database $menu->add(DOL_URL_ROOT."/admin/system/database.php", $langs->trans("Database")); diff --git a/htdocs/admin/triggers.php b/htdocs/admin/triggers.php index 4375900debe..06a11724e25 100644 --- a/htdocs/admin/triggers.php +++ b/htdocs/admin/triggers.php @@ -14,15 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** - \file htdocs/admin/triggers.php - \brief Page de configuration et activation des triggers - \version $Revision$ -*/ + * \file htdocs/admin/triggers.php + * \brief Page de configuration et activation des triggers + * \version $Id$ + */ require("./pre.inc.php"); include_once(DOL_DOCUMENT_ROOT ."/interfaces.class.php"); diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 05c3ea4a61b..3da890bbc06 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -131,6 +131,7 @@ class MenuLeft { $newmenu->add(DOL_URL_ROOT."/admin/system/index.php?leftmenu=system", $langs->trans("SystemInfo")); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/dolibarr.php", $langs->trans("Dolibarr"),1); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/constall.php", $langs->trans("AllParameters"),2); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/modules.php", $langs->trans("Modules"),2); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/triggers.php", $langs->trans("Triggers"),2); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/about.php", $langs->trans("About"),2); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/os.php", $langs->trans("OS")); diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index 757d2731f56..9145cc0a3b0 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -133,6 +133,7 @@ class MenuLeft { $newmenu->add(DOL_URL_ROOT."/admin/system/index.php?leftmenu=system", $langs->trans("SystemInfo")); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/dolibarr.php", $langs->trans("Dolibarr"),1); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/constall.php", $langs->trans("AllParameters"),2); + if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/modules.php", $langs->trans("Modules"),2); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/triggers.php", $langs->trans("Triggers"),2); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/about.php", $langs->trans("About"),2); if ($leftmenu=="system") $newmenu->add_submenu(DOL_URL_ROOT."/admin/system/os.php", $langs->trans("OS")); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5bc4cac3be0..2f1aa5d7abe 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -581,7 +581,11 @@ SystemInfoDesc=System information is miscellanous technical information you get SystemAreaForAdminOnly=This area is available for administrator users only. None of the Dolibarr permissions can reduce this limit. CompanyFundationDesc=Edit on this page all known information of the company or fundation you need to manage DisplayDesc=You can choose each parameter related to the Dolibarr look and feel here -TriggersAvailable=Triggers available +AvailableModules=Available modules +ToActivateModule=To activate modules, go on setup Area. +SessionTimeOut=Time out for session +SessionExplanation=This number guarantee that session will never expire before this delay. But PHP sessoin management does not guaranty that session always expire after this delay: This occurs if a system to clean cache session is running.
Note: with no particular system, internal PHP process will clean session every about %s/%s access but only during access made by other sessions. +TriggersAvailable=Available triggers TriggersDesc=Triggers are files that will modify the behaviour of Dolibarr workflow once copied into the directory htdocs/includes/triggers. They realised new actions, activated on Dolibarr events (new company creation, invoice validation, ...). TriggerDisabledByName=Triggers in this file are disabled by the -NORUN suffix in their name. TriggerDisabledAsModuleDisabled=Triggers in this file are disabled as module %s is disabled. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index a128e4d5b98..f018dc326e3 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -580,6 +580,10 @@ SystemInfoDesc=Les informations syst SystemAreaForAdminOnly=Cet espace n'est accessible qu'aux utilisateurs de type administrateurs. Aucune permission Dolibarr ne permet d'étendre le cercle des utilisateurs autorisés à cet espace. CompanyFundationDesc=Éditer sur cette page toutes les informations connues sur la société ou association que vous devez gérer DisplayDesc=Vous pouvez choisir ici tous les paramètres liés à l'apparence de Dolibarr +AvailableModules=Modules disponibles +ToActivateModule=Pour activer des modules, aller dans l'espace Configuration. +SessionTimeOut=Time out des sessions +SessionExplanation=Ce nombre garantie que la session n'expire pas avant ce délai. Mais la gestion de session PHP ne garantie pas que la session expire après ce délai: Ce sera le cas si un systeme de nettoyage des caches sessions est en place.
Note: Sans mécanisme special, le mécanisme interne à PHP nettoie la session tous les %s/%s accès environ mais uniquement lors d'accès fait par d'autres sessions. TriggersAvailable=Triggers disponibles TriggersDesc=Les triggers sont des fichiers qui, une fois déposés dans le répertoire htdocs/includes/triggers, modifient le comportement du workflow de Dolibarr. Ils réalisent des actions supplémentaires, déclenchées par les événements Dolibarr (création société, validation facture, clôture contrat...). TriggerDisabledByName=Triggers de ce fichier désactivés par le suffix -NORUN dans le nom du fichier. diff --git a/htdocs/lib/antispamimage.php b/htdocs/lib/antispamimage.php index 1eeb3426adb..370f16e4ddc 100644 --- a/htdocs/lib/antispamimage.php +++ b/htdocs/lib/antispamimage.php @@ -37,6 +37,7 @@ require_once ARTICHOW."/AntiSpam.class.php"; // Init session $sessionname="DOLSESSID_".$dolibarr_main_db_name; +if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT); session_name($sessionname); session_start(); dolibarr_syslog("Session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"]); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4c3b70fd808..1ab647ed45f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -139,10 +139,10 @@ if (! defined('NOREQUIREAJAX') && $conf->use_javascript_ajax) require_once(DOL_D // Init session $sessionname="DOLSESSID_".$dolibarr_main_db_name; -//ini_set('session.gc_maxlifetime',10); +if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT); session_name($sessionname); session_start(); -dolibarr_syslog("Session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"]); +dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"]); /* * Phase identification diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index 4078438b66f..08ed615a734 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -43,9 +43,14 @@ if ($conf->phenix->enabled && $conf->phenix->cookie) dolibarr_syslog("End session in DOLSESSID_".$dolibarr_main_db_name); session_destroy(); + +// Init session $sessionname="DOLSESSID_".$dolibarr_main_db_name; +if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT); session_name($sessionname); session_start(); +dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"]); + session_unregister("dol_login"); header("Location: ".DOL_URL_ROOT."/index.php"); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index b372a26684d..94447f5d3f0 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -151,7 +151,7 @@ if ($_GET["action"] == 'edit') $var=!$var; print ''.$langs->trans("Language").''; print ''.($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$conf->global->MAIN_LANG_DEFAULT).''; - print 'conf->MAIN_LANG_DEFAULT?" checked":""); + print 'conf->MAIN_LANG_DEFAULT?" checked":""); print ! empty($conf->global->MAIN_DEMO)?' disabled="true"':''; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; print ''; @@ -163,7 +163,7 @@ if ($_GET["action"] == 'edit') $var=!$var; print ''.$langs->trans("MaxSizeList").''; print ''.$conf->global->MAIN_SIZE_LISTE_LIMIT.''; - print 'conf->MAIN_SIZE_LISTE_LIMIT?" checked":""); + print 'conf->MAIN_SIZE_LISTE_LIMIT?" checked":""); print ! empty($conf->global->MAIN_DEMO)?' disabled="true"':''; // Disabled for demo print '> '.$langs->trans("UsePersonalValue").''; print ''; @@ -194,13 +194,13 @@ else $var=!$var; print ''.$langs->trans("Language").''; print ''.($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$conf->global->MAIN_LANG_DEFAULT).''; - print 'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + print 'conf->MAIN_LANG_DEFAULT?" checked":"").'> '.$langs->trans("UsePersonalValue").''; print ''.($fuser->conf->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$fuser->conf->MAIN_LANG_DEFAULT).''; $var=!$var; print ''.$langs->trans("MaxSizeList").''; print ''.$conf->global->MAIN_SIZE_LISTE_LIMIT.''; - print 'conf->MAIN_SIZE_LISTE_LIMIT?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + print 'conf->MAIN_SIZE_LISTE_LIMIT?" checked":"").'> '.$langs->trans("UsePersonalValue").''; print '' . $fuser->conf->MAIN_SIZE_LISTE_LIMIT . ''; print '
'; @@ -250,7 +250,7 @@ function show_theme($fuser,$edit=0) print ''.$langs->trans("DefaultSkin").''; print ''.$conf->global->MAIN_THEME.''; - print 'conf->MAIN_THEME?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + print 'conf->MAIN_THEME?" checked":"").'> '.$langs->trans("UsePersonalValue").''; print ' '; $var=!$var; diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 434162757ca..2895e50b9fd 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -32,9 +32,10 @@ require_once(DOL_DOCUMENT_ROOT."/lib/usergroups.lib.php"); // Init session $sessionname="DOLSESSID_".$dolibarr_main_db_name; +if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT); session_name($sessionname); session_start(); -dolibarr_syslog("Session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"]); +dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"]); $user->getrights('user');