X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2Findex.php;h=75df65cf201a517b1a569ce1a49634120c985399;hb=132f0aa5741fd4a1cf0016bf859d685d75bd249b;hp=e18625ef4b8b9e22398208143f6c38dfcd9c7623;hpb=ba124be15839e2a62fa793b70869e0209f8daf90;p=brisk.git
diff --git a/web/index.php b/web/index.php
index e18625e..75df65c 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.
';
@@ -336,6 +350,8 @@ supported by:
+
+
@@ -348,8 +364,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) {
@@ -375,16 +397,19 @@ supported by:
-Digita il tuo nickname per accedere ai tavoli della briscola.
-
+Digita il tuo nickname per accedere ai tavoli della briscola.
+
(se usi firefox e qualcosa non funziona
prova a ricaricare la pagina con
Ctrl + F5)
-
+
@@ -414,6 +439,7 @@ Digita il tuo nickname per accedere ai tavoli della briscola.
+
@@ -426,7 +452,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 +466,35 @@ if ($BRISK_SHOWHTML == "debugtable") {
}
else {
?>
- // alert("INDEX START");
+ // alert("INDEX START");
menu_init();
- topbanner_init();
+
xhr_rd = createXMLHttpRequest();
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);
+}
+?>
+
}
@@ -490,7 +527,7 @@ else {