X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2FObj%2Fbrisk.phh;h=2c83a01cdecb1fd9daa675441877ef1cad50579e;hb=89023025985f8c0b07bb4e4500c787bfe23d999e;hp=9368916ecfac86c78e2780e7da754fd527e655c0;hpb=97a6d096a5e248061cbc7d1769f2ad866a7b9bcd;p=brisk.git diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 9368916..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)); } @@ -2097,7 +2110,7 @@ class Brisk /* MLANG: "Non puoi cambiare nick a un tavolo per soli autenticati.", "Il nickname \'%s\' è già registrato, se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghostN." */ if ($user->is_auth()) { - if (strcasecmp($user->name,$name_new) != 0) { + if (strcasecmp($user->name, $name_new) != 0) { if (( ($user->flags & USER_FLAG_MAP_AUTH) != USER_FLAG_ISOLAUTH) && ($user->subst == 'standup' || ($user->subst != 'standup' && $this->table[$user->table]->auth_type == TABLE_AUTH_TY_PUBL) @@ -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(); }