X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;ds=inline;f=web%2Findex.php;h=3b14fa67f4c288f45aeeb944e1f8dc39478e1f74;hb=0b7233416fd5e2ef879170f5a49ff936ff27deef;hp=74d94954d936362a90cb2ebab5e6266a9e583185;hpb=6215f77e418ed06e4822895bf644b585d32ba959;p=brisk.git diff --git a/web/index.php b/web/index.php index 74d9495..3b14fa6 100644 --- a/web/index.php +++ b/web/index.php @@ -2,7 +2,10 @@ /* * brisk - index.php * - * Copyright (C) 2006-2007 matteo.nastasi@milug.org + * Copyright (C) 2006-2009 Matteo Nastasi + * mailto: nastasi@alternativeoutput.it + * matteo.nastasi@milug.org + * web: http://www.alternativeoutput.it * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,56 +24,147 @@ * */ -require_once("brisk.phh"); +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; + +require_once("briskin5/Obj/briskin5.phh"); if (DEBUGGING == "local" && $_SERVER['REMOTE_ADDR'] != '127.0.0.1') { echo "Debugging time!"; exit; } -log_load($sess, "LOAD: index.php"); +log_load("index.php"); + + +function poll_dom() { + GLOBAL $G_with_poll, $G_poll_title, $G_poll_entries; + + if ($G_with_poll) { + $ret = sprintf('
+ + + garbage_manager(TRUE); - if (($user = &$bri->get_user($sess, &$idx)) != FALSE) { + log_main("pre garbage_manager UNO"); + $room->garbage_manager(TRUE); + log_main("post garbage_manager"); + if (($user = &$room->get_user($sess, &$idx)) != FALSE) { + log_main("user stat: ".$user->stat); if ($user->stat == "table") { - header ("Location: table.php"); - unlock_data($sem); + 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; } $ACTION = "room"; } + + if (Room::save_data(&$room) == FALSE) { + echo "ERRORE SALVATAGGIO\n"; + exit; + } } if ($ACTION == "login" && isset($name)) { - $bri->garbage_manager(TRUE); + + log_main("pre garbage_manager DUE"); + + if (isset($pass_private) == FALSE) { + $pass_private = FALSE; + } + + $room->garbage_manager(TRUE); /* try login */ - if (($user = &$bri->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; + $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); - $bri->standup_update(&$user); + $room->standup_update(&$user); - if (save_data(&$bri) == FALSE) { + if (Room::save_data(&$room) == FALSE) { echo "ERRORE SALVATAGGIO\n"; exit; } } 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 .= 'Tavolo '.$i.' ';
+ $tables .= ''; + $tables .= ' ';
+ $tables .= ' | '."\n";
- if ($i % 4 == 3)
+ $tables .= 'Tavolo '.$i.' ';
$tables .= sprintf('', $i);
$tables .= sprintf('', $i);
- $tables .= ' | '."\n";
+ if ($ii % 4 == 3)
$tables .= '||
';
- $tables .= ' ';
- $tables .= 'Giocatori in piedi '; - - $tables .= sprintf(''); - $tables .= ''; - $tables .= ' |
';
+ $standup .= ' ';
+ /* MLANG: "Giocatori in piedi", "Come ottenere user e password" */
+ // $standup .= ' Giocatori in piedi - Come ottenere user e password - ';
+ $standup .= 'Giocatori in piedi ';
- $tables .= ' |
-
-
-
-
-
-
-
- |
-
+'
+).' |
+'.($G_with_topbanner ? '
|
-
-
-
-
+'
+).' |
+
\n");
+ /* printf($brisk_vertical_menu, ' ', $brisk_donate); + printf($brisk_vertical_menu, ' ', + $brisk_donate);*/ + printf($brisk_vertical_menu, ' ', + $brisk_donate); + + + if ($G_with_sidebanner xor $G_with_sidebanner2) { + printf(" "); + } + + if ($G_with_sidebanner) { + printf("%s", $G_sidebanner); + if ($G_with_sidebanner2) { + printf(" "); + } + } + + + if ($G_with_sidebanner2) { + printf("%s", $G_sidebanner2); + } + + printf(" | ");
?>
-
sess"; ?>">
+
|
+ + | + + |