From 37365c4bde464fd3fe7c34576b321aa42f0b3f8e Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 28 Sep 2007 06:07:24 +0000 Subject: [PATCH] Added session lifetime warning git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7429 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/index.php | 7 +++++++ ihtml/themes/default/login.tpl | 1 + include/class_config.inc | 14 ++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/html/index.php b/html/index.php index e72e27783..603db4d6b 100644 --- a/html/index.php +++ b/html/index.php @@ -52,6 +52,13 @@ function displayLogin() $smarty->assign ("ssl", ""); } + if(!$config->check_session_lifetime()){ + $smarty->assign ("lifetime", _("Warning").": ". + _("The session lifetime configured in your gosa.conf doesn't match the php.ini settings.")); + }else{ + $smarty->assign ("lifetime", ""); + } + /* Generate server list */ $servers= array(); if (isset($_POST['server'])){ diff --git a/ihtml/themes/default/login.tpl b/ihtml/themes/default/login.tpl index 1b5b79afd..83f48de0e 100644 --- a/ihtml/themes/default/login.tpl +++ b/ihtml/themes/default/login.tpl @@ -31,6 +31,7 @@
{t}Please use your username and your password to log into the site administration system.{/t}
{if $ssl}{$ssl}{/if} + {if $lifetime}{$lifetime}{/if}
diff --git a/include/class_config.inc b/include/class_config.inc index 036872656..9e4339de7 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -791,6 +791,20 @@ class config { return (""); } + + /* On debian systems the session files are deleted with + * a cronjob, which detects all files older than specified + * in php.ini:'session.gc_maxlifetime' and removes them. + * This function checks if the gosa.conf value matches the range + * defined by session.gc_maxlifetime. + */ + function check_session_lifetime() + { + $cfg_lifetime = $this->data['MAIN']['SESSION_LIFETIME']; + $ini_lifetime = ini_get('session.gc_maxlifetime'); + $deb_system = file_exists('/etc/debian_version'); + return(!($deb_system && ($ini_lifetime < $cfg_lifetime))); + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -- 2.30.2