X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex.php;h=160bee04201126e78b8fb712b5d7a3fc420f1ab4;hb=a3885a63b7558381d0bc464a3f1c68311f1b2fea;hp=e18625ef4b8b9e22398208143f6c38dfcd9c7623;hpb=ba124be15839e2a62fa793b70869e0209f8daf90;p=brisk.git diff --git a/web/index.php b/web/index.php index e18625e..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 .= '
Utente e/o password errati.
'; + 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.
'; @@ -145,10 +174,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 +212,7 @@ function main() $brisk_donate = ""; - + /* MLANG: "briscola chiamata in salsa ajax", */ $brisk_header_form = '
@@ -233,6 +264,7 @@ google_color_url = "000000";
'; +/* MLANG: ALL THE VERTICAL MENU */ $brisk_vertical_menu = '
@@ -306,12 +338,13 @@ $brisk_vertical_menu = '
-


+

sponsored by:

'.$altout_carousel.'


supported by:


-

+
+


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

Brisk + @@ -336,6 +370,8 @@ supported by:

+ + @@ -348,8 +384,14 @@ supported by:

var sess = "not_connected"; window.onload = function() { - menu_init(); - topbanner_init(); + // alert(window.onbeforeunload); + + login_init(); + g_withflash = DetectFlashVer(6,0,0); if (g_withflash == false) { @@ -371,20 +413,27 @@ supported by:

?> - +



-Digita il tuo nickname per accedere ai tavoli della briscola.
-
-
- - - -
-
+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)
-
+



@@ -414,6 +463,7 @@ Digita il tuo nickname per accedere ai tavoli della briscola.
+ @@ -426,7 +476,7 @@ Digita il tuo nickname per accedere ai tavoli della briscola.
var gst = new globst(); var g_is_spawn = 0; var topbanner_sfx, topbanner_dx; - + // var nonunload = false; var g_withflash = false; var g_imgct= 0; var g_imgtot = g_preload_img_arr.length; @@ -440,24 +490,37 @@ if ($BRISK_SHOWHTML == "debugtable") { } else { ?> - // alert("INDEX START"); + // alert("INDEX START"); menu_init(); - topbanner_init(); + xhr_rd = createXMLHttpRequest(); + // xhr_rd.setRequestHeader("Content-type", "text/html; charset=utf-8"); sess = ""; tra = new train($('room_tit')); window.onunload = onunload_cb; + window.onbeforeunload = onbeforeunload_cb; g_withflash = DetectFlashVer(6,0,0); if (g_withflash == false) { $("proflash").innerHTML = 'Audio con Flash.
'; } else $("proflashext").innerHTML = ""; + setTimeout(xhr_rd_poll, 0, sess); // alert("ARR LENGTH "+g_preload_img_arr.length); setTimeout(preload_images, 0, g_preload_img_arr, g_imgct); $("txt_in").focus(); Il nickname che stai usando è già registrato,

se il suo proprietario si autentificherà

verrai rinominato d'ufficio come ghostN.", "torna ai tavoli" */ + echo show_notify("
Il nickname che stai usando è già registrato,

se il suo proprietario si autentificherà

verrai rinominato d'ufficio come ghostN.", 0, "torna ai tavoli", 400, 150); +} +?> + } @@ -487,13 +550,48 @@ else {
+
- +
+ + + +
+
+ Garantisci per un tuo conoscente: +

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