add check on new argument sess where if it isn't equal to FALSE is compared with...
[brisk.git] / web / Obj / brisk.phh
index 1fa4e68..e41c252 100644 (file)
@@ -871,12 +871,12 @@ class User {
 
 
   // SHSPLIT save and load function for the User class.
-  function load_data($id
+  static function load_data($id, $sess
   {
-    GLOBAL $sess;
-
     // error_log("User::load_data BEGIN", 0);
 
+    log_main("load_data: id [".$id."] sess [".($sess == FALSE ? "FALSE" : $sess)."] ");
+
     $doexit = FALSE;
     do {
       if (($tok = @ftok(FTOK_PATH."/user".$id, "B")) == -1) {
@@ -895,7 +895,11 @@ class User {
       if ($shm = shm_attach($tok, $shm_sz)) {
        $user = @shm_get_var($shm, $tok);
        
-       log_only("bri ==  ".($user == FALSE ?   "FALSE" : "TRUE")."  bri ===  ".($user === FALSE ? "FALSE" : "TRUE")."  bri isset ".(isset($user) ?   "TRUE" : "FALSE"));
+        if ($sess != FALSE && $user->sess != $sess) {
+            $doexit = TRUE;
+            break;
+        }
+       log_only("user ==  ".($user == FALSE ?   "FALSE" : "TRUE")."  user ===  ".($user === FALSE ? "FALSE" : "TRUE")."  user isset ".(isset($user) ?   "TRUE" : "FALSE"));
        if (isset($user)) 
          log_only("bri count ".count($user));