From c5633cf4c38ac8553de7f6b6d7996ffa30a6adf3 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Sat, 22 Nov 2008 10:41:01 +0000 Subject: [PATCH] username and password added --- web/index.php | 59 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/web/index.php b/web/index.php index 6949055..4657e04 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,11 +89,22 @@ 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"; - + if ($idx < 0) { + $idx = -$idx - 1; + $login_exists = TRUE; + } + else + $login_exists = FALSE; + log_legal($curtime, $user->sess, $user->name, "STAT:LOGIN", ''); @@ -106,7 +118,9 @@ function main() } else { /* Login Rendering */ - if ($idx == -2) + 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.
'; @@ -337,6 +351,7 @@ supported by:

+ @@ -349,8 +364,9 @@ 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) { @@ -376,17 +392,17 @@ supported by:





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

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




@@ -431,7 +447,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; @@ -452,17 +468,24 @@ else { 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.


", 0, "torna ai tavoli", 400, 150); +} +?> + } @@ -495,7 +518,7 @@ else {
- +
-- 2.17.1