From 668d517a393df3188f7935045ff3c14779c9aa38 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 29 May 2012 14:46:44 +0000 Subject: [PATCH] * Admin: remove session timeout from EGroupware config and read it via ini_get("session.gc_maxlifetime") as config fails for many reasons, if different from php.ini setting --- admin/templates/default/config.tpl | 18 ++++-------------- phpgwapi/inc/class.egw_session.inc.php | 13 ++++++------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/admin/templates/default/config.tpl b/admin/templates/default/config.tpl index e9bf71ade6..c640ae23d5 100644 --- a/admin/templates/default/config.tpl +++ b/admin/templates/default/config.tpl @@ -17,16 +17,6 @@ - {lang_Timeout_for_sessions_in_seconds_(default_14400_=_4_hours)}: - - - - - {lang_Timeout_for_application_session_data_in_seconds_(default_86400_=_1_day)}: - - - - {lang_Would_you_like_to_show_each_application's_upgrade_status_?}: @@ -46,7 +36,7 @@ - + {lang_Should_the_login_page_include_a_language_selectbox_(useful_for_demo-sites)_?}: @@ -75,7 +65,7 @@ - + {lang_Enter_the_VFS-Path_where_additional_images,_icons_or_logos_can be_placed_(and_found_by_EGroupwares_applications)._The_path_MUST_start_with_/,and_be_readable_by_all_users}: diff --git a/phpgwapi/inc/class.egw_session.inc.php b/phpgwapi/inc/class.egw_session.inc.php index e83ba46498..0cefc6d010 100644 --- a/phpgwapi/inc/class.egw_session.inc.php +++ b/phpgwapi/inc/class.egw_session.inc.php @@ -203,11 +203,6 @@ class egw_session { $GLOBALS['egw_info']['server']['install_id'] = md5(common::randomstring(15)); } - if (!isset($GLOBALS['egw_info']['server']['sessions_timeout'])) - { - $GLOBALS['egw_info']['server']['sessions_timeout'] = 14400; - $save_rep = true; - } if (!isset($GLOBALS['egw_info']['server']['max_history'])) { $GLOBALS['egw_info']['server']['max_history'] = 20; @@ -223,13 +218,17 @@ class egw_session $config->value('num_unsuccessful_id',$GLOBALS['egw_info']['server']['num_unsuccessful_id']); $config->value('num_unsuccessful_ip',$GLOBALS['egw_info']['server']['num_unsuccessful_ip']); $config->value('install_id',$GLOBALS['egw_info']['server']['install_id']); - $config->value('sessions_timeout',$GLOBALS['egw_info']['server']['sessions_timeout']); $config->value('max_history',$GLOBALS['egw_info']['server']['max_history']); $config->save_repository(); } } self::set_cookiedomain(); - ini_set('session.gc_maxlifetime', $GLOBALS['egw_info']['server']['sessions_timeout']); + + // set session_timeout from global php.ini and default to 14400=4h, if not set + if (!($GLOBALS['egw_info']['server']['sessions_timeout'] = ini_get('session.gc_maxlifetime'))) + { + ini_set('session.gc_maxlifetime', $GLOBALS['egw_info']['server']['sessions_timeout']=14400); + } } /**