X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fuser.phh;h=1d693d5bbeb0b78343c863fda61298addb3e1c4a;hb=a98d543666ef272243bd167647e79073222b0a9d;hp=3d09ceb8da0b7989d72af3515e97c719ca6e66f5;hpb=f7068bc71e92a6290b6efcd8c10771aab8bc3449;p=brisk.git diff --git a/web/Obj/user.phh b/web/Obj/user.phh index 3d09ceb..1d693d5 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -209,6 +209,7 @@ class User { $thiz->handpt = -1; $thiz->exitislock = TRUE; + $thiz->flags_db = 0x00; $thiz->flags = 0x00; $thiz->rec = FALSE; @@ -258,6 +259,7 @@ class User { $this->handpt = $from->handpt; $this->exitislock = $from->exitislock; + $this->flags_db = $from->flags_db; $this->flags = $from->flags; $this->rec = $from->rec; @@ -326,6 +328,7 @@ class User { $thiz->exitislock = $from->exitislock; $thiz->the_end = $from->the_end; + $thiz->flags_db = $from->flags_db; $thiz->flags = $from->flags; $thiz->rec = $from->rec; @@ -372,6 +375,24 @@ class User { return FALSE; } + function flags_db_get($mask) + { + return ($this->flags_db & $mask); + } + + function flags_db_set($flags_db, $mask) + { + $flags_db_old = $this->flags_db & (~$mask); + $this->flags_db = ($flags_db_old | ($flags_db & $mask)); + + return ($flags_db_old); + } + + function flags_get($mask) + { + return ($this->flags & $mask); + } + function flags_set($flags, $mask) { $flags_old = $this->flags & (~$mask); @@ -385,7 +406,11 @@ class User { if (($bdb = BriskDB::create()) == FALSE) { return FALSE; } - return ($bdb->user_prefs_update($this->code, ($this->flags & (USER_FLAG_TY_ALL | USER_FLAG_MAP_AUTH)), + if ($this->flags_db == $this->flags) + return TRUE; + + $this->flags_db = $this->flags; + return ($bdb->user_prefs_update($this->code, ($this->flags_db & (USER_FLAG_TY_ALL | USER_FLAG_MAP_AUTH)), $this->rec->supp_comp_get())); } @@ -399,10 +424,11 @@ class User { function state_store() { - if (($bdb = BriskDB::create()) == FALSE) { + if (($bdb = BriskDB::create()) == FALSE) { return FALSE; } - return ($bdb->user_state_update($this->code, ($this->flags & (USER_FLAG_TY_ALL | USER_FLAG_MAP_AUTH)), + $this->flags_db = $this->flags; + return ($bdb->user_state_update($this->code, ($this->flags_db & (USER_FLAG_TY_ALL | USER_FLAG_MAP_AUTH)), $this->rec->disa_reas_get())); }