]> git.datanom.net - qtadmin.git/blobdiff - lib/utils.inc.php
Add check for valid session
[qtadmin.git] / lib / utils.inc.php
index 8cf730e3ea5468d02fb14a824d7a5bd8faf8f210..3c3ff9765ef75cbee3488fde2fd875cd3446352d 100644 (file)
@@ -43,16 +43,20 @@ class Utils {
 
         $this->log("Init Utils", 4);
 
 
         $this->log("Init Utils", 4);
 
+        $this->log("__construct[1]: user ".var_export($this->settings['user'], true), 3);
         $this->startSession();
         $this->startSession();
+        $this->log("__construct[2]: user ".var_export($this->settings['user'], true), 3);
 
         if (! isset($_SESSION['settings'])) {
             $this->initSettings();
         }
 
         if (! isset($_SESSION['settings'])) {
             $this->initSettings();
         }
+        $this->log("__construct[3]: user ".var_export($this->settings['user'], true), 3);
         $this->settings = $_SESSION['settings'];
         $this->settings = $_SESSION['settings'];
+        $this->log("__construct[4]: user ".var_export($this->settings['user'], true), 3);
 
         if ($CFG->auth_method == 'HTTP_AUTH') {
 
         if ($CFG->auth_method == 'HTTP_AUTH') {
-            if (isset($this->server['PHP_AUTH_USER'])) {
-                $this->settings['user'] = $this->server['PHP_AUTH_USER'];
+            if (isset($_SERVER['PHP_AUTH_USER'])) {
+                $this->settings['user'] = $_SERVER['PHP_AUTH_USER'];
                 $this->settings['loginStatus'] = 'OK';
                 if ($CFG->admin_user == $this->settings['user'])
                     $this->settings['admin'] = true;
                 $this->settings['loginStatus'] = 'OK';
                 if ($CFG->admin_user == $this->settings['user'])
                     $this->settings['admin'] = true;
@@ -99,7 +103,6 @@ class Utils {
         }
 
         $this->settings = array(
         }
 
         $this->settings = array(
-            'server' => $_SERVER,
             'user' => null,
             'admin' => false,
             'loginStatus' => 'Not logged in',
             'user' => null,
             'admin' => false,
             'loginStatus' => 'Not logged in',
@@ -262,8 +265,8 @@ class Utils {
                 $loggedIn = true;
             } else {
                 if ($CFG->auth_method == 'HTTP_AUTH') {
                 $loggedIn = true;
             } else {
                 if ($CFG->auth_method == 'HTTP_AUTH') {
-                    if (isset($this->server['PHP_AUTH_USER'])) {
-                        $this->settings['user'] = $this->server['PHP_AUTH_USER'];
+                    if (isset($_SERVER['PHP_AUTH_USER'])) {
+                        $this->settings['user'] = $_SERVER['PHP_AUTH_USER'];
                         $loggedIn = true;
                     }
                 }
                         $loggedIn = true;
                     }
                 }
This page took 0.067507 seconds and 5 git commands to generate.