* 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

This commit is contained in:
Ralf Becker 2012-05-29 14:43:33 +00:00
parent de8bc4771c
commit a1f6f70330
2 changed files with 10 additions and 21 deletions

View File

@ -19,16 +19,6 @@
</tr>
<tr class="row_off">
<td>{lang_Timeout_for_sessions_in_seconds_(default_14400_=_4_hours)}:</td>
<td><input size="8" name="newsettings[sessions_timeout]" value="{value_sessions_timeout}"></td>
</tr>
<tr class="row_on">
<td>{lang_Timeout_for_application_session_data_in_seconds_(default_86400_=_1_day)}:</td>
<td><input size="8" name="newsettings[sessions_app_timeout]" value="{value_sessions_app_timeout}"></td>
</tr>
<tr class="row_on">
<td>{lang_Would_you_like_to_show_each_application's_upgrade_status_?}:</td><td>
<select name="newsettings[checkappversions]">
<option value="">{lang_No}</option>
@ -38,7 +28,7 @@
</td>
</tr>
<tr class="row_off">
<tr class="row_on">
<td>{lang_Would_you_like_to_automaticaly_load_new_langfiles_(at_login-time)_?}:</td>
<td>
<select name="newsettings[disable_autoload_langfiles]">
@ -48,7 +38,7 @@
</td>
</tr>
<tr class="row_on">
<tr class="row_off">
<td>{lang_Should_the_login_page_include_a_language_selectbox_(useful_for_demo-sites)_?}:</td>
<td>
<select name="newsettings[login_show_language_selection]">
@ -58,7 +48,7 @@
</td>
</tr>
<tr class="row_off">
<tr class="row_on">
<td>{lang_How_should_EMail_addresses_for_new_users_be_constructed?}:</td>
<td>
<select name="newsettings[email_address_format]">
@ -77,7 +67,7 @@
</td>
</tr>
<tr class="row_on">
<tr class="row_off">
<td>{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}:</td>
<td><input name="newsettings[vfs_image_dir]" value="{value_vfs_image_dir}"></td>
</tr>

View File

@ -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);
}
}
/**