$ret = sprintf('gst.st = %d; ', $user_step);
- $prefs = Client_prefs::from_user($user);
- $ret .= sprintf('prefs_load(\'%s\', false, false);', json_encode($prefs));
-
- if(false) {
- if ($user->flags & USER_FLAG_ISOLAUTH) {
- $ret .= 'list_set(\'isolation\', false, \''.$mlang_brisk['tit_onisol'][$G_lang].'\' ); ';
- }
- else if ($user->flags & USER_FLAG_LISTAUTH) {
- $ret .= 'list_set(\'auth\', false, \''.$mlang_brisk['tit_onauth'][$G_lang].'\' ); ';
- }
- else {
- $ret .= 'list_set(\'all\', false, \'\' ); ';
- }
+ if ($user->is_auth()) {
+ $model = '{ "listen": { "__type": "radio" } }';
+ $content = '{ "listen": {"val": "' . ($user->flags & USER_FLAG_ISOLAUTH ? "2" :
+ ($user->flags & USER_FLAG_LISTAUTH ? "1" : "0")) .
+ '" } }';
+ $ret .= sprintf('g_prefsf.fields_descr_set(JSON.parse(\'%s\'));', $model);
+ $ret .= sprintf('g_prefsf.json2dom(JSON.parse(\'%s\'));', $content);
}
if ($user->subst == 'standup')
echo $this->info_show($user, urldecode($info_user), $dt);
} while(0);
}
+ else if (strncmp($msg, "/prefsn", 7) == 0) {
+ do {
+ if (! $user->is_auth()) {
+ if ($mlang_indwr) {
+ $to_user = nickserv_msg($dt, $mlang_indwr['info_auth'][$G_lang]);
+ }
+ else {
+ $to_user = nickserv_msg($dt, "error");
+ }
+ break;
+ }
+ echo $this->prefsn_show($user, $dt);
+ } while(0);
+ }
else if (strncmp($msg, "/st ", 4) == 0) {
log_main("chatt_send BEGIN");
}
}
+/* function login_consistency:
+ name length must be less or equal than 12 chars,
+ no more than 2 consecutive same character (or generic digits) are allowed */
function login_consistency($name)
{
$old_c = '';
for ($i = 0 ; $i < mb_strlen($name) ; $i++) {
$c = mb_substr($name, $i, 1);
if (mb_ereg_match ("[a-zA-Z0-9]", $c)) {
+ if (mb_ereg_match ("[0-9]", $c)) {
+ $c = "0";
+ }
if ($old_c != $c) {
$old_c = $c;
$old_ct = 1;