X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex_wr.php;fp=web%2Findex_wr.php;h=001b51fdb18de4b6295e62d67c076a0c25216e52;hb=89023025985f8c0b07bb4e4500c787bfe23d999e;hp=cf41230199e0fe7e4aca994c889298c63bea7951;hpb=bddfecf27b05ebf105929f29ef23c26d3b258c3c;p=brisk.git diff --git a/web/index_wr.php b/web/index_wr.php index cf41230..001b51f 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -391,17 +391,26 @@ function index_wr_main(&$brisk, $remote_addr_full, $get, $post, $cookie) [json] => {"listen":{"act":"1"}} */ if ($post['model_name'] == 'prefsf') { - fprintf(STDERR, "INFO: prefsf preset [%x]\n", $user->flags_cur); - $cont = json_decode($post['json']); - $new_flags_cur = $user->flags_cur & ~(USER_FLAG_ISOLAUTH | USER_FLAG_LISTAUTH); - if ($cont->listen->cur == '1') { - $new_flags_cur |= USER_FLAG_LISTAUTH; + 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 ($cont->listen->cur == '2') { - $new_flags_cur |= USER_FLAG_ISOLAUTH; + else if ($user->stat == 'room' && $user->subst == 'sitdown') { + $brisk->table_update($user); } - $user->flags_cur = $new_flags_cur; - fprintf(STDERR, "INFO: prefsf postset [%x]\n", $user->flags_cur); + echo "1"; + return TRUE; } } else if ($argz[0] == 'prefs') {