X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex_wr.php;h=001b51fdb18de4b6295e62d67c076a0c25216e52;hb=refs%2Fheads%2Fmeet-appr;hp=e94cd902534cbf1a2163d937b081faf4ee799b69;hpb=f7068bc71e92a6290b6efcd8c10771aab8bc3449;p=brisk.git diff --git a/web/index_wr.php b/web/index_wr.php index e94cd90..001b51f 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -380,6 +380,39 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) return FALSE; } } + else if ($argz[0] == 'prefsf') { + fprintf(STDERR, "INFO: prefsf case [%s]\n", $post['F_act']); + if (!isset($post['model_name']) || !isset($post['json'])) + return FALSE; + + /* [F_act] => update + [model_name] => prefsf + [counter] => 1 + [json] => {"listen":{"act":"1"}} + */ + if ($post['model_name'] == 'prefsf') { + if ($post['F_act'] == 'update' || $post['F_act'] == 'store') { + $cont = json_decode($post['json']); + $leaf = ($post['F_act'] == 'update' ? 'cur' : 'val'); + + $listen_flags = (($cont->listen->$leaf == '1' ? USER_FLAG_LISTAUTH : 0) | + ($cont->listen->$leaf == '2' ? USER_FLAG_ISOLAUTH : 0)); + $user->flags_set($listen_flags, USER_FLAG_MAP_AUTH); + if ($post['F_act'] == 'store' + && $user->flags_db_get(USER_FLAG_MAP_AUTH) != $user->flags_get(USER_FLAG_MAP_AUTH)) { + $user->prefs_store(); + } + } + if ($user->stat == 'room' && $user->subst == 'standup') { + $brisk->standup_update($user); + } + else if ($user->stat == 'room' && $user->subst == 'sitdown') { + $brisk->table_update($user); + } + echo "1"; + return TRUE; + } + } else if ($argz[0] == 'prefs') { if ($argz[1] == 'save') { if (!isset($post['prefs'])) { @@ -395,8 +428,8 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) $prefs = Client_prefs::from_user($user); } $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; "; - $user->comm[$user->step % COMM_N] .= sprintf('prefs_load(\'%s\', true, %s);', json_encode($prefs), - 'false'); + $user->comm[$user->step % COMM_N] .= sprintf('prefs_load(\'%s\', true, %s);', json_encode($prefs), + 'false'); $user->step_inc(); if ($argz[1] == 'save') { @@ -427,8 +460,8 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) $prefs = Client_prefs::from_user($user); } $user->comm[$user->step % COMM_N] = "gst.st = ".($user->step+1)."; "; - $user->comm[$user->step % COMM_N] .= sprintf('prefs_load(\'%s\', true, %s);', json_encode($prefs), - 'false'); + $user->comm[$user->step % COMM_N] .= sprintf('prefs_load(\'%s\', true, %s);', json_encode($prefs), + 'false'); $user->step_inc(); if ($argz[1] == 'save') {