]> git.datanom.net - qtadmin.git/blobdiff - lib/utils.inc.php
Add check for valid session
[qtadmin.git] / lib / utils.inc.php
index ba2fbc9dd48e9a3bb8bfba05a418f795b91dcc94..640d828edfffedf540804b91d052ace2d6284489 100644 (file)
@@ -4,6 +4,7 @@ require_once $CFG->root .'config.php';
 
 class Utils {
 
+    private $timeout = false;
     private $settings;
     private $header = '<!DOCTYPE html>
 <html>
@@ -48,12 +49,18 @@ class Utils {
             $this->startSession();
         }
 
+        if (false !== $this->timeout) {
+            $timeout = $this->timeout;
+        } else {
+            $timeout = 0;
+        }
+
         $this->settings = array(
             'server' => $_SERVER,
             'user' => null,
             'admin' => false,
             'loginStatus' => 'Not logged in',
-            'timeout' => 0
+            'timeout' => $timeout
         );
 
         $_SESSION['settings'] = $this->settings;
@@ -205,7 +212,7 @@ class Utils {
         }
 
         if ($loggedIn == false) {
-            echo '$this->user: '.$this->user.' $_SESSION[\'user\']: '.$_SESSION['user'];
+            echo '$this->settings: '.var_export($this->settings, true);
             echo 'R_TIME: '.date('c', $_SERVER['REQUEST_TIME']).' L_ACT: '.date('c', $_SESSION['LAST_ACTIVITY']);
             //exit;
         }
This page took 0.372111 seconds and 5 git commands to generate.