summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 146f180)
raw | patch | inline | side by side (parent: 146f180)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 17 Jan 2006 11:59:39 +0000 (11:59 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 17 Jan 2006 11:59:39 +0000 (11:59 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2504 594d385d-05f5-0310-b6e9-bd551577e9d8
contrib/gosa.conf | patch | blob | history | |
html/main.php | patch | blob | history |
diff --git a/contrib/gosa.conf b/contrib/gosa.conf
index ebc57722fe16389d60036a44b8f98dc530fa45e9..bb200461f2b92aa5e0130062e195bbc92211b890 100644 (file)
--- a/contrib/gosa.conf
+++ b/contrib/gosa.conf
pwminlen="6"
forceglobals="false"
smbhash='{SMBHASH}'
+ session_lifetime="7200"
displayerros="{errorlvl}">
<location name="{LOCATIONNAME}"
diff --git a/html/main.php b/html/main.php
index 33f0c900a32469ff0d15efdb48a19b209a7f9994..dc9b66ece56f61539c818c67e356971d2361f731 100644 (file)
--- a/html/main.php
+++ b/html/main.php
bindtextdomain($domain, "$BASE_DIR/locale");
textdomain($domain);
+/* Set cookie lifetime to one day */
+session_set_cookie_params(24*60*60);
+
/* Remember everything we did after the last click */
-session_set_cookie_params(2*60*60);
session_start ();
+
+
if ($_SERVER["REQUEST_METHOD"] == "POST"){
@DEBUG (DEBUG_POST, __LINE__, __FUNCTION__, __FILE__, $_POST, "_POST");
}
}
$config= $_SESSION['config'];
+
+/* Check for invalid sessions */
+if(empty($_SESSION['_LAST_PAGE_REQUEST'])){
+ $_SESSION['_LAST_PAGE_REQUEST']= time();
+}else{
+
+ /* check GOsa.conf for defined session lifetime */
+ if(isset($config->data['MAIN']['SESSION_LIFETIME'])){
+ $max_life = $config->data['MAIN']['SESSION_LIFETIME'];
+ }else{
+ $max_life = 60*60*2;
+ }
+
+ /* get time difference between last page reload */
+ $request_time = (time()-$_SESSION['_LAST_PAGE_REQUEST']);
+
+ /* If page wasn't reloaded for more than max_life seconds
+ * kill session
+ */
+ if($request_time > $max_life){
+ session_unset();
+ gosa_log ("main.php called without session - logging out");
+ header ("Location: logout.php");
+ exit;
+ }
+ //echo "Session was ".$request_time." s inactive";
+ $_SESSION['_LAST_PAGE_REQUEST'] = time();
+}
+
+
@DEBUG (DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
/* Set template compile directory */