X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex.php;h=160bee04201126e78b8fb712b5d7a3fc420f1ab4;hb=a3885a63b7558381d0bc464a3f1c68311f1b2fea;hp=69490556490311dd6e3cfc2313f713f6017bd82a;hpb=bc29696ba05142894c798c81931ab2bf23dae5c3;p=brisk.git diff --git a/web/index.php b/web/index.php index 6949055..160bee0 100644 --- a/web/index.php +++ b/web/index.php @@ -25,6 +25,7 @@ */ require_once("Obj/brisk.phh"); +require_once("Obj/auth.phh"); require_once("Obj/proxyscan.phh"); // Use of proxies isn't allowed. @@ -42,7 +43,7 @@ log_load("index.php"); function main() { GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local; - GLOBAL $sess, $name, $table_idx, $table_token, $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER; + GLOBAL $sess, $name, $pass_private, $table_idx, $table_token, $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER; $body = ""; $tables = ""; @@ -88,12 +89,37 @@ function main() if ($ACTION == "login" && isset($name)) { log_main("pre garbage_manager DUE"); + + if (isset($pass_private) == FALSE) { + $pass_private = FALSE; + } + $room->garbage_manager(TRUE); /* try login */ - if (($user = &$room->add_user(&$sess, &$idx, $name, $_SERVER['REMOTE_ADDR'])) != FALSE) { + if (($user = &$room->add_user(&$sess, &$idx, $name, $pass_private, $_SERVER['REMOTE_ADDR'])) != FALSE) { $ACTION = "room"; - - log_legal($curtime, $user->sess, $user->name, "STAT:LOGIN", ''); + if ($idx < 0) { + $idx = -$idx - 1; + $login_exists = TRUE; + } + else + $login_exists = FALSE; + + log_legal($curtime, $user, "STAT:LOGIN", ''); + + // recovery lost game + if ($user->stat == "table") { + if (Room::save_data(&$room) == FALSE) { + echo "ERRORE SALVATAGGIO\n"; + exit; + } + log_main("unlock Room"); + Room::unlock_data($sem); + setcookie("table_token", $user->table_token, $curtime + 31536000); + setcookie("table_idx", $user->table, $curtime + 31536000); + header ("Location: briskin5/index.php"); + exit; + } // setcookie ("sess", "", time() + 180); @@ -106,7 +132,10 @@ function main() } else { /* Login Rendering */ - if ($idx == -2) + /* MLANG: "Utente e/o password errati.", "Il nickname deve contenere almeno una lettera o una cifra.", "Spiacenti, non ci sono più posti liberi. Riprova più tardi.", "Il tuo nickname è già in uso." */ + if ($idx == -3) + $body .= '
';
$standup .= ' ';
+ /* MLANG: "Giocatori in piedi", "Come ottenere user e password" */
+ // $standup .= ' Giocatori in piedi - Come ottenere user e password - ';
$standup .= 'Giocatori in piedi ';
$standup .= sprintf('');
- $standup .= '';
+ $standup .= '';
$standup .= ' |
![]() | - + |