+
+ Challenges::unlock_data($a_sem);
+ }
+ else {
+ echo "CHALLENGE LOCK FAILED\n";
+ return FALSE;
+ }
+ }
+ else if ($argz[0] == 'auth') {
+ printf("challenge|ok");
+ }
+ else if ($argz[0] == 'help') {
+ /* MLANG: "torna ai tavoli" */
+ echo show_notify(str_replace("\n", " ", $G_room_help[$G_lang]), 0, $mlang_indwr['btn_close'][$G_lang], 600, 500);
+ }
+ else if ($argz[0] == 'about') {
+ echo show_notify(str_replace("\n", " ", $G_room_about[$G_lang]), 0, $mlang_indwr['btn_close'][$G_lang], 400, 230);
+ }
+ else if ($argz[0] == 'passwdhowto') {
+ echo show_notify(str_replace("\n", " ", $G_room_passwdhowto[$G_lang]), 0, $mlang_indwr['btn_close'][$G_lang], 400, 200);
+ }
+ else if ($argz[0] == 'roadmap') {
+ echo show_notify(str_replace("\n", " ", $G_room_roadmap[$G_lang]), 0, $mlang_indwr['btn_close'][$G_lang], 400, 200);
+ }
+ else if ($argz[0] == 'placing') {
+ require_once("briskin5/Obj/briskin5.phh");
+ require_once("briskin5/Obj/placing.phh");
+
+ echo show_notify(str_replace("\n", " ", placings_show(FALSE)), 0, $mlang_indwr['btn_close'][$G_lang], 800, 600);
+ }
+ else if ($argz[0] == 'whysupport') {
+ echo show_notify(str_replace("\n", " ", $G_room_whysupport[$G_lang]), 0, $mlang_indwr['btn_close'][$G_lng], 400, 200);
+ }
+ else {
+ log_wr("Get User Error");
+ echo "Get User Error:" + $argz[0];
+ return FALSE;
+ }
+ return TRUE;
+ } // end if (($user = $brisk->get_user($sess, ... == FALSE) {
+
+ $brisk->sess_cur_set($user->sess);
+ $argz = explode('|', xcapemesg($mesg));
+
+ log_wr('POSTSPLIT: '.$argz[0]);
+
+ // LACC UPDATED
+ $user->lacc = $curtime;
+
+ if (array_search($user->ip, $G_black_list) !== FALSE) {
+ // TODO: find a way to add a nonblocking sleep(5) here
+ return (FALSE);
+ }
+
+ if ($argz[0] == 'ping') {
+ log_wr("PING RECEIVED");
+ }
+ else if ($argz[0] == 'prefs') {
+ 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') {
+ $brisk->standup_update($user);
+ }
+ else if ($user->stat == 'room' && $user->subst == 'sitdown') {
+ log_main("chatt_send pre table update");
+ $brisk->table_update($user);
+ log_main("chatt_send post table update");
+ }
+ }
+ echo "1";
+ return TRUE;
+ }
+ else if ($argz[0] == 'shutdown') {
+ log_auth($user->sess, "Shutdown session.");
+
+ $user->reset();
+
+ log_rd2("AUTO LOGOUT.");
+ if ($user->subst == 'sitdown' || $user->stat == 'table')
+ $brisk->room_wakeup($user);
+ else if ($user->subst == 'standup')
+ $brisk->room_outstandup(&$user);
+ else {
+ log_rd2("SHUTDOWN FROM WHAT ???");
+ }
+ }
+ else if ($argz[0] == 'warranty') {
+ if (($cli_name = gpcs_var('cli_name', $get, $post, $cookie)) === FALSE)
+ $cli_name = "";
+
+ if (($cli_email = gpcs_var('cli_email', $get, $post, $cookie)) === FALSE)
+ $cli_email = "";
+
+
+ $mesg_to_user = "";
+
+ log_wr("INFO:SKIP:argz == warranty name: [".$cli_name."] AUTH: ".($user->flags & USER_FLAG_AUTH));
+ if ($user->flags & USER_FLAG_AUTH) {
+ if (($wa_lock = Warrant::lock_data(TRUE)) != FALSE) {
+ if (($fp = @fopen(LEGAL_PATH."/warrant.txt", 'a')) != FALSE) {