logout idle fix (moved to constants)
authorniekt0 <niekt0@kyberia.cz>
Tue, 5 Apr 2011 22:03:59 +0000 (00:03 +0200)
committerniekt0 <niekt0@kyberia.cz>
Tue, 5 Apr 2011 22:03:59 +0000 (00:03 +0200)
wwwroot/inc/logout_idle.inc
wwwroot/inc/senate.inc

index 8b5abb42bfafd3625265983ec2c14e9b1974b943..70955efb6ad9136661d5bcfa8a159c12a1637c59 100644 (file)
@@ -1,7 +1,13 @@
 <?php
-if(!isset($_SESSION['last_request']) || $_SESSION['last_request'] >= (time() - 60*60)) { //TODO predelat timeout do konstanty v nastaveni
+
+// Logout user, if idle for more then LOGOUT_IDLE_SEC seconds
+
+if (( !isset($_SESSION['last_request'] ) || 
+       ( $_SESSION['last_request'] >= (time() - LOGOUT_IDLE_SEC))) { 
        $_SESSION['last_request'] = time();
 } else {
        require_once(INCLUDE_DIR."eventz/logout.inc");
        logout();
 }
+
+?>
index f99800dbd64384c2138216cdb66e31267a9930b4..3dd497692639a07b14e5f46c6f234f57afab90ab 100644 (file)
@@ -2,6 +2,9 @@
 define('DAILY_K',30);
 define('REGISTRATION_VOTES',2); //too small so far
 
+// logout after one hour
+define('LOGOUT_IDLE_SEC', 3600);
+
 // An attempt to remove hard-code constants from code
 define('REGISTRATION_TEXT_NODE',791946);
 define('REGISTRATION_REQUEST_NODE',2091448);
This page took 0.144082 seconds and 4 git commands to generate.