X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;fp=web%2FObj%2Fbrisk.phh;h=2c83a01cdecb1fd9daa675441877ef1cad50579e;hb=89023025985f8c0b07bb4e4500c787bfe23d999e;hp=29ec0e82d0860337ff505e0346376b4a4adbed16;hpb=bddfecf27b05ebf105929f29ef23c26d3b258c3c;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 29ec0e8..2c83a01 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -1417,13 +1417,26 @@ class Brisk $ret = sprintf('gst.st = %d; ', $user_step); if ($user->is_auth()) { - $model = '{ "listen": { "__type": "radio" } }'; - $content = array('listen' => array('val' => ($user->flags & USER_FLAG_ISOLAUTH ? "2" : - ($user->flags & USER_FLAG_LISTAUTH ? "1" : "0")), - 'cur' => ($user->flags_cur & USER_FLAG_ISOLAUTH ? "2" : - ($user->flags_cur & USER_FLAG_LISTAUTH ? "1" : "0")))); - - $ret .= sprintf('g_prefsf.fields_descr_set(JSON.parse(\'%s\'));', $model); + $model = array('listen' => array('__type' => 'radio')); + $content = array('listen' => array('val' => ($user->flags_db & USER_FLAG_ISOLAUTH ? "2" : + ($user->flags_db & USER_FLAG_LISTAUTH ? "1" : "0")), + 'cur' => ($user->flags & USER_FLAG_ISOLAUTH ? "2" : + ($user->flags & USER_FLAG_LISTAUTH ? "1" : "0")))); + if ($user->is_supp_custom()) { + $comps = $user->rec->supp_comp_get_array(); + $model['fg'] = array('__type' => 'fields', 'r' => array('__type' => 'value'), + 'g' => array('__type' => 'value'), 'b' => array('__type' => 'value')); + $model['bg'] = array('__type' => 'fields', 'r' => array('__type' => 'value'), + 'g' => array('__type' => 'value'), 'b' => array('__type' => 'value')); + $content['fg'] = array('r' => array('val' => $comps['fg']['r'], 'cur' => $comps['fg']['r']), + 'g' => array('val' => $comps['fg']['g'], 'cur' => $comps['fg']['g']), + 'b' => array('val' => $comps['fg']['b'], 'cur' => $comps['fg']['b'])); + $content['bg'] = array('r' => array('val' => $comps['bg']['r'], 'cur' => $comps['bg']['r']), + 'g' => array('val' => $comps['bg']['g'], 'cur' => $comps['bg']['g']), + 'b' => array('val' => $comps['bg']['b'], 'cur' => $comps['bg']['b'])); + } + + $ret .= sprintf('g_prefsf.fields_descr_set(JSON.parse(\'%s\'));', json_encode($model)); $ret .= sprintf('g_prefsf.json2dom(JSON.parse(\'%s\'));', json_encode($content)); } @@ -2551,11 +2564,11 @@ class Brisk $this->user[$idx]->ip = $ip; $this->user[$idx]->rec = $authenticate; - $this->user[$idx]->flags = $user_type; - $this->user[$idx]->flags |= ($authenticate != FALSE ? USER_FLAG_AUTH : 0x00); - $this->user[$idx]->flags |= ( ($pass != FALSE && $bdb == FALSE) ? USER_FLAG_DBFAILED : 0x00); - log_auth("XXX", sprintf("FLAGS: [%x]", $this->user[$idx]->flags)); - $this->user[$idx]->flags_cur = $this->user[$idx]->flags; + $this->user[$idx]->flags_db = $user_type; + $this->user[$idx]->flags_db |= ($authenticate != FALSE ? USER_FLAG_AUTH : 0x00); + $this->user[$idx]->flags_db |= ( ($pass != FALSE && $bdb == FALSE) ? USER_FLAG_DBFAILED : 0x00); + log_auth("XXX", sprintf("FLAGS: [%x]", $this->user[$idx]->flags_db)); + $this->user[$idx]->flags = $this->user[$idx]->flags_db; if ($authenticate != FALSE) { $this->user[$idx]->code = $authenticate->code_get(); }