X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Findex_wr.php;h=8571c76d1bc89874c849e1cfc5fcef473cc81fc8;hb=c5daeb726565fb9a3f3ea3954588b9f5ffba7c95;hp=7cb9c35efb58267f1fee430c77d6e6d671eeefd6;hpb=3dc6d58fd477565017745b33c752232166a0b508;p=brisk.git diff --git a/web/index_wr.php b/web/index_wr.php index 7cb9c35..8571c76 100644 --- a/web/index_wr.php +++ b/web/index_wr.php @@ -203,20 +203,34 @@ function index_wr_main(&$room, $remote_addr_full, $get, $post, $cookie) log_wr("PING RECEIVED"); } else if ($argz[0] == 'prefs') { - fprintf(STDERR, "\n\n PREFS pre\n\n"); - if (!isset($post['prefs'])) { - return FALSE; - } - - $prefs = Client_prefs::from_json($post['prefs']); - fprintf(STDERR, "\n\n PREFS [%s]\n\n", print_r($prefs, TRUE)); - - $prefs->store($user, TRUE); + if ($argz[1] == 'save') { + if (!isset($post['prefs'])) { + return FALSE; + } + if (($prefs = Client_prefs::from_json($post['prefs'])) == FALSE) { + $prefs = Client_prefs::from_user($user); + } + $prefs->store($user, TRUE); + } + else { // reset case as default + $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->step_inc(); + + if ($argz[1] == 'save') { + if ($user->stat == 'room' && $user->subst == 'standup') { + $room->standup_update($user); + } + else if ($user->stat == 'room' && $user->subst == 'sitdown') { + log_main("chatt_send pre table update"); + $room->table_update($user); + log_main("chatt_send post table update"); + } + } echo "1"; return TRUE; }