$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));
}
/* MLANG: "<b>Non puoi cambiare nick a un tavolo per soli autenticati.</b>", "Il nickname <b>\'%s\'</b> è già registrato, <b>se il suo proprietario si autentificherà verrai rinominato d\'ufficio come ghost<i>N</i>.</b>" */
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)
$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();
}