From dea98f631a4c291603662d521328540b7c9ff43a Mon Sep 17 00:00:00 2001
From: hickert
Date: Tue, 17 Jan 2006 12:26:30 +0000
Subject: [PATCH] Changed session timeout
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2505 594d385d-05f5-0310-b6e9-bd551577e9d8
---
html/logout.php | 13 +++++++++++++
html/main.php | 4 ++--
ihtml/themes/default/logout.tpl | 1 +
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/html/logout.php b/html/logout.php
index ba44304bf..1ffbf9d8d 100644
--- a/html/logout.php
+++ b/html/logout.php
@@ -25,6 +25,18 @@ header("Content-type: text/html; charset=UTF-8");
get_dir_list("$BASE_DIR/plugins");
session_start ();
+/* This message will be set if the logout was caused by main.php-
+ * if inactivity of user was > than the defined value in gosa.conf (session_lifetime)
+ * This Message will be displayed in the logout template.
+ * To force displaying the logout template, we have to unset the session.
+ */
+if(isset($_SESSION['kick_message'])){
+ $kmsg = $_SESSION['kick_message'];
+ @session_unset();
+}else{
+ $kmsg = "";
+}
+
/* Do logout-logging and destroy session */
if (!isset($_SESSION["config"])){
/* Language setup */
@@ -52,6 +64,7 @@ if (!isset($_SESSION["config"])){
} else {
$smarty->compile_dir= '/var/spool/gosa/';
}
+ $smarty->assign("kmsg",$kmsg);
$smarty->display (get_template_path('headers.tpl'));
$smarty->display (get_template_path('logout.tpl'));
@session_destroy ();
diff --git a/html/main.php b/html/main.php
index dc9b66ece..b07cf1b8c 100644
--- a/html/main.php
+++ b/html/main.php
@@ -83,12 +83,12 @@ if(empty($_SESSION['_LAST_PAGE_REQUEST'])){
* kill session
*/
if($request_time > $max_life){
- session_unset();
+ $_SESSION['kick_message'] = sprintf(_("The session timeout configuration is set to '%s' seconds. But have been inactive for '%s' seconds."),$max_life,$request_time)." "._("You can change the value for session_lifetime in your gosa.conf.")." ";
gosa_log ("main.php called without session - logging out");
header ("Location: logout.php");
exit;
}
- //echo "Session was ".$request_time." s inactive";
+// echo "Session was ".$request_time." s inactive";
$_SESSION['_LAST_PAGE_REQUEST'] = time();
}
diff --git a/ihtml/themes/default/logout.tpl b/ihtml/themes/default/logout.tpl
index 28cd633a7..5189da0cc 100644
--- a/ihtml/themes/default/logout.tpl
+++ b/ihtml/themes/default/logout.tpl
@@ -7,6 +7,7 @@
{t}The last interaction with the GOsa web interface has been some time ago in the past. For security reasons, the session has been closed. To continue with administrative tasks, please sign in again.{/t}