-$sem = Room::lock_data(TRUE);
-if (($room = &Room::load_data()) == FALSE) {
- echo "Load data error";
- log_wr("Load data error");
- Room::unlock_data($sem);
- exit;
-}
-if (($user = $room->get_user($sess, &$idx)) == FALSE) {
- Room::unlock_data($sem);
- $argz = explode('|', xcapemesg($mesg));
-
- if ($argz[0] == 'getchallenge') {
- GLOBAL $cli_name;
- if (($a_sem = Challenges::lock_data(TRUE)) != FALSE) {
- log_main("chal lock data success");
-
- if (($chals = &Challenges::load_data()) != FALSE) {
-
- $token = uniqid("");
- // echo '2|'.$argz[1].'|'.$token.'|'.$_SERVER['REMOTE_ADDR'].'|'.$curtime.'|';
- // exit;
-
- if (($login_new = validate_name(urldecode($cli_name))) != FALSE) {
- if ($chals->add($login_new, $token, $_SERVER['REMOTE_ADDR'], $curtime) != FALSE) {
- log_send("SUCCESS: token:".$token);
- echo '0|'.$token;
- }
- else {
- log_send("getchallenge FAILED");
- echo '1|';
- }
- }
- else {
- log_send("getchallenge FAILED");
- echo '1|';
- }
- if ($chals->ismod()) {
- Challenges::save_data(&$chals);
- }
- }
-
-
- Challenges::unlock_data($a_sem);
- }
- }
- 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, 220);
- }
- 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];
- }
- exit;
-}
-$argz = explode('|', xcapemesg($mesg));