X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fuser.phh;h=1d693d5bbeb0b78343c863fda61298addb3e1c4a;hb=a98d543666ef272243bd167647e79073222b0a9d;hp=a1bc74d7d1965415d931e3f10f610e6763365441;hpb=a28328a1aa1ece8ffdaf65150936161d0ba207f2;p=brisk.git diff --git a/web/Obj/user.phh b/web/Obj/user.phh index a1bc74d..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())); } @@ -920,6 +946,30 @@ function chunked_fini() return sprintf("0\r\n"); } +function prefsn_get() +{ + GLOBAL $G_lang, $mlang_brisk, $G_base; + + $mesg = ""; + $user_code = -1; + + $listen = ($this->flags & USER_FLAG_MAP_AUTH) >> 2; + if ($this->rec != FALSE) { + $ret = $this->rec->supp_comp_get_array(); + } + else { + $ret = array( + "fg" => array("r" => 0, "g" => 0, "b" => 0), + "bg" => array("r" => 0, "g" => 0, "b" => 0) + ); + } + + return (array("ret" => 0, + "listen" => $listen, + "fg" => $ret["fg"], + "bg" => $ret["bg"])); +} + } // end class User