supp_comp partial support (db/prefs management, usage is missing)
[brisk.git] / web / Obj / user.phh
index f31d78b..416dbb4 100644 (file)
@@ -121,6 +121,7 @@ class User {
   var $table_pos;  // idx on the table
   var $table_token;// token that identify a game on a table
   var $flags;      // Bitfield with: AUTHENTICATE: 0x02 
+  var $rec;        // field with user db record or FALSE
   var $the_end;    // Flag to change the end of the session
 
   var $chat_lst;      // Last chat line
@@ -173,7 +174,8 @@ class User {
     $thiz->exitislock = TRUE;
 
     $thiz->flags      = 0x00;
-    
+    $thiz->rec        = FALSE;
+
     $thiz->chattime   = array_fill(0, CHAT_N, 0);
     $thiz->chat_cur   = 0;
     $thiz->chat_lst   = "";
@@ -218,6 +220,7 @@ class User {
     $this->exitislock = $from->exitislock;
 
     $this->flags      = $from->flags;
+    $this->rec        = $from->rec;
 
     $this->chattime   = array();
     for ($i = 0 ; $i < CHAT_N ; $i++)
@@ -282,6 +285,7 @@ class User {
     $thiz->the_end    = $from->the_end;
 
     $thiz->flags      = $from->flags;
+    $thiz->rec        = $from->rec;
 
     $thiz->chattime   = array_fill(0, CHAT_N, 0);
     $thiz->chat_cur   = 0;
@@ -310,7 +314,8 @@ class User {
       if (($bdb = BriskDB::create()) == FALSE) {
           return FALSE;
       }
-      return ($bdb->user_update_flags($this->code, ($this->flags & (USER_FLAG_TY_ALL | USER_FLAG_MAP_AUTH))));
+      return ($bdb->user_prefs_update($this->code, ($this->flags & (USER_FLAG_TY_ALL | USER_FLAG_MAP_AUTH)),
+                                      $this->rec->supp_comp));
   }
 
   function rd_data_set($curtime, $transp, $enc, $stat, $subst, $step, $from)