X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex.php;h=52d878f9e4ccead20bccd42bc906d6c24be6bc24;hb=6aaadfdf64934a162818929b331b7d9a20d29994;hp=c53bc95e599c4e47255229cd075012c04215a4f3;hpb=93d7a6690daa9a9138277a8d83edb766fb2bab8a;p=brisk.git diff --git a/web/index.php b/web/index.php index c53bc95..52d878f 100644 --- a/web/index.php +++ b/web/index.php @@ -22,6 +22,7 @@ * */ +require_once("Obj/user.phh"); require_once("Obj/brisk.phh"); require_once("Obj/auth.phh"); require_once("Obj/proxyscan.phh"); @@ -38,8 +39,20 @@ $mlang_room = array( 'userpasserr' => array('it' => 'Utente e/o password errati 'en' => 'Standing players'), 'headline' => array('it' => 'briscola chiamata in salsa ajax', 'en' => 'declaration briscola in ajax sauce (Beta)'), - 'welcome' => array('it' => 'Digita il tuo nickname per accedere ai tavoli della briscola', - 'en' => 'Enter your nickname to access to the tables of briscola'), + 'welcome' => array('it' => 'Digita il tuo nickname per accedere ai tavoli della briscola.', + 'en' => 'Enter your nickname to access to the tables of briscola.'), + 'reas_unkn' => array('it' => 'Logout per motivi sconosciuti.', + 'en' => 'Logout with unknown reason.'), + 'reas_lout' => array('it' => 'Orevoire.', + 'en' => 'EN Orevoire.'), + 'reas_tout' => array('it' => 'Abbiamo perso le tue tracce, quindi ti abbiamo disconnesso.', + 'en' => 'EN Abbiamo perso le tue tracce, quindi ti abbiamo disconnesso.'), + 'reas_ttot' => array('it' => 'Abbiamo perso le tue tracce mentre stavi giocando, quindi ti abbiamo disconnesso.', + 'en' => 'EN Abbiamo perso le tue tracce mentre stavi giocando, quindi ti abbiamo disconnesso.'), + 'reas_anon' => array('it' => 'L\' accesso attraverso sistemi di anonimizzazione non è consentito.', + 'en' => 'EN L\' accesso attraverso sistemi di anonimizzazione non è consentito.'), + 'reas_anot' => array('it' => 'La tua sessione è stata assegnata ad un altro browser.', + 'en' => 'EN La tua sessione è stata assegnata ad un altro browser.'), 'btn_enter' => array('it' => 'entra', 'en' => 'enter'), 'passwarn' => array('it' => 'Se non hai ancora una password, lascia il campo in bianco ed entra.', @@ -297,7 +310,7 @@ function sidebanners_render($sidebanner, $sidebanner_idx) } } -function index_main(&$brisk, $transp_type, &$header_out, $remote_addr_full, $get, $post, $cookie) +function index_main(&$brisk, $transp_type, $header, &$header_out, $remote_addr_full, $get, $post, $cookie) { GLOBAL $G_with_donors, $G_donors_cur, $G_donors_all; GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local; @@ -329,6 +342,7 @@ function index_main(&$brisk, $transp_type, &$header_out, $remote_addr_full, $get $tables = ""; $standup = ""; $ACTION = "login"; + $last_msg = ""; if (isset($BRISK_SHOWHTML) == FALSE) { $is_table = FALSE; @@ -336,33 +350,56 @@ function index_main(&$brisk, $transp_type, &$header_out, $remote_addr_full, $get $curtime = time(); /* Actions */ - + if (($ghost_sess = $brisk->ghost_sess->pop($sess)) != FALSE) { + switch ($ghost_sess->reas) { + case GHOST_SESS_REAS_LOUT: + $last_msg = $mlang_room['reas_lout'][$G_lang]; + break; + case GHOST_SESS_REAS_ANOT: + $last_msg = $mlang_room['reas_anot'][$G_lang]; + break; + case GHOST_SESS_REAS_TOUT: + $last_msg = $mlang_room['reas_tout'][$G_lang]; + break; + case GHOST_SESS_REAS_TTOT: + $last_msg = $mlang_room['reas_ttot'][$G_lang]; + break; + case GHOST_SESS_REAS_ANON: + $last_msg = $mlang_room['reas_anon'][$G_lang]; + break; + default: + $last_msg = $mlang_room['reas_unkn'][$G_lang]; + break; + } + } if (validate_sess($sess)) { log_main("pre garbage_manager UNO"); $brisk->garbage_manager(TRUE); log_main("post garbage_manager"); if (($user = &$brisk->get_user($sess, &$idx)) != FALSE) { - $brisk->sess_cur_set($user->sess); - log_main("user stat: ".$user->stat); - if ($user->stat == "table") { - $cookies = new Cookies(); - $cookies->add("table_token", $user->table_token, $curtime + 31536000); - $cookies->add("table_idx", $user->table, $curtime + 31536000); - $header_out['cookies'] = $cookies; - $header_out['Location'] = "briskin5/index.php"; - return TRUE; + if ($user->the_end == FALSE) { + $brisk->sess_cur_set($user->sess); + log_main("user stat: ".$user->stat); + if ($user->stat == "table") { + $cookies = new Cookies(); + $cookies->add("table_token", $user->table_token, $curtime + 31536000); + $cookies->add("table_idx", $user->table, $curtime + 31536000); + $header_out['cookies'] = $cookies; + $header_out['Location'] = "briskin5/index.php"; + return TRUE; + } + $ACTION = "room"; } - $ACTION = "room"; } } + $banned = FALSE; if ($ACTION == "login" && isset($name)) { log_main("pre garbage_manager DUE"); if (isset($pass_private) == FALSE || $pass_private == "") { $pass_private = FALSE; - $banned = FALSE; if ($brisk->ban_check($remote_addr)) { // TODO: find a way to add a nonblocking sleep(5) here $banned = TRUE; @@ -374,7 +411,7 @@ function index_main(&$brisk, $transp_type, &$header_out, $remote_addr_full, $get /* try login */ if ($banned == FALSE && - ($user = $brisk->add_user(&$sess, &$idx, $name, $pass_private, $remote_addr, $cookie)) != FALSE) { + ($user = $brisk->add_user(&$sess, &$idx, $name, $pass_private, $remote_addr, $header, $cookie)) != FALSE) { $brisk->sess_cur_set($user->sess); $ACTION = "room"; if ($idx < 0) { @@ -393,9 +430,6 @@ function index_main(&$brisk, $transp_type, &$header_out, $remote_addr_full, $get $header_out['Location'] = "briskin5/index.php"; return TRUE; } - - // setcookie ("sess", "", time() + 180); - $brisk->standup_update(&$user); } else { /* Login Rendering */ @@ -1034,7 +1068,9 @@ supported by:
echo "$body"; ?>
-


+
+
+