X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex.php;h=bc0735f82116cbd871640920466dfdc83c0f2266;hb=461259aa77611a333c703802cb905a829ef40f81;hp=69490556490311dd6e3cfc2313f713f6017bd82a;hpb=bc29696ba05142894c798c81931ab2bf23dae5c3;p=brisk.git diff --git a/web/index.php b/web/index.php index 6949055..bc0735f 100644 --- a/web/index.php +++ b/web/index.php @@ -2,7 +2,7 @@ /* * brisk - index.php * - * Copyright (C) 2006-2008 Matteo Nastasi + * Copyright (C) 2006-2009 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -25,8 +25,12 @@ */ require_once("Obj/brisk.phh"); +require_once("Obj/auth.phh"); require_once("Obj/proxyscan.phh"); +$mlang_room = array( 'userpasserr' => array('it' => 'Utente e/o password errati.', + 'en' => 'Wrong user and/or password.') ); + // Use of proxies isn't allowed. if (!$G_is_local && is_proxy()) exit; @@ -42,8 +46,9 @@ 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; + GLOBAL $G_lang, $G_lng, $mlang_room; + $is_login = FALSE; $body = ""; $tables = ""; $standup = ""; @@ -88,12 +93,35 @@ 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; + $is_login = TRUE; + } + + 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 +134,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 .= '
'.$mlang_room['userpasserr'][$G_lang].'
'; + else if ($idx == -2) $body .= '
Il nickname deve contenere almeno una lettera o una cifra.
'; else if ($idx == -1) $body .= '
Spiacenti, non ci sono più posti liberi. Riprova più tardi.
'; @@ -128,8 +159,13 @@ function main() if ($ACTION == "room") { $tables .= '
'; $tables .= ''; - for ($i = 0 ; $i < TABLES_N ; $i++) { - if ($i % 4 == 0) + for ($ii = 0 ; $ii < TABLES_N ; $ii++) { + if ($user->flags & USER_FLAG_AUTH) + $i = $ii; + else + $i = TABLES_N - $ii - 1; + + if ($ii % 4 == 0) $tables .= ''; $tables .= ''."\n"; - if ($i % 4 == 3) + if ($ii % 4 == 3) $tables .= ''; } $tables .= '
'; $tables .= '
Tavolo '.$i.'
'; @@ -137,7 +173,7 @@ function main() $tables .= sprintf('
', $i); $tables .= '
'; $tables .= '
'; @@ -145,10 +181,12 @@ function main() $standup .= '
'; $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 .= '
'; } @@ -181,7 +219,7 @@ function main() $brisk_donate = ""; - + /* MLANG: "briscola chiamata in salsa ajax", */ $brisk_header_form = '
@@ -233,13 +271,14 @@ google_color_url = "000000";
'; +/* MLANG: ALL THE VERTICAL MENU */ $brisk_vertical_menu = '
- + +
sponsored by:

'.$altout_carousel.'


supported by:


-

+
+


%s @@ -328,6 +432,7 @@ supported by:

Brisk + @@ -337,20 +442,30 @@ supported by:

+ + + +
?> - +



-Digita il tuo nickname per accedere ai tavoli della briscola.
-
- -
user: - - - -
pwd: - -
-
+Digita il tuo nickname per accedere ai tavoli della briscola.

+
+ + + + + + + + +

+Se non hai ancora una password, lascia il campo in bianco ed entra.

(se usi firefox e qualcosa non funziona
prova a ricaricare la pagina con Ctrl + F5)




@@ -421,22 +541,28 @@ Digita il tuo nickname per accedere ai tavoli della briscola.
+ + +
-Chat
+Chat
+
- +
+ +
+
+ Garantisci per un tuo conoscente: +

+ +
+ + + + + + + + +
+
+
+
+ Invia un messaggio o una segnalazione all'amministratore: +

+
+ + + + + + + + + + + + +
+