]> git.datanom.net - qtadmin.git/commitdiff
Add check for valid session
authorMichael Rasmussen <mir@datanom.net>
Sat, 6 Jun 2015 10:23:18 +0000 (12:23 +0200)
committerMichael Rasmussen <mir@datanom.net>
Sat, 6 Jun 2015 10:23:18 +0000 (12:23 +0200)
js/timer.js
lib/utils.inc.php

index f68f0841f11d279fd19defce6ff5ccd026569796..10172712b11080b7d32491cee1e3fb328f804a4c 100644 (file)
@@ -17,14 +17,14 @@ function myTimer() {
         if (timeLeft < last || last == -1) {
             last = timeLeft;
             timeLeft = '< ' + timeLeft + ' min';
-            console.log('Session soon to expire');
+            /*console.log('Session soon to expire');*/
             document.getElementById("time").style.background = "red";
             document.getElementById("timer").innerHTML = timeLeft;
         }
     } else {
         if ((timeLeft < last && timeLeft > 0) || last == -1) {
             last = timeLeft;
-            console.log('Session valid < ' + timeLeft);
+            /*console.log('Session valid < ' + timeLeft);*/
             timeLeft = '< ' + timeLeft + ' min';
             document.getElementById("timer").innerHTML = timeLeft;
         }
index 3c3ff9765ef75cbee3488fde2fd875cd3446352d..dcdd8518eb4d7b458876edf51d49eb23f80fb6ea 100644 (file)
@@ -143,7 +143,8 @@ class Utils {
         $time = $_SERVER['REQUEST_TIME'];
         if (isset($_SESSION['LAST_ACTIVITY']) &&
                 ($time - $_SESSION['LAST_ACTIVITY']) >= $this->settings['timeout']) {
-            echo 'R_TIME: '.date('c', $time).' L_ACT: '.date('c', $_SESSION['LAST_ACTIVITY']);
+            $this->log('R_TIME: '.date('c', $time).' L_ACT: '.date('c', $_SESSION['LAST_ACTIVITY'].
+            'Test: '.($time - $_SESSION['LAST_ACTIVITY'])).' >= '.$this->settings['timeout'], 3);
             $this->logout();
         } else {
             $_SESSION['LAST_ACTIVITY'] = $time;
This page took 0.033745 seconds and 5 git commands to generate.