X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex.php;h=2b04597f118be250ac76fa6536a20c88d66711d8;hb=4fc44e9a6f4f15b3d86cfb378d7a8d73cffe0844;hp=e18625ef4b8b9e22398208143f6c38dfcd9c7623;hpb=ba124be15839e2a62fa793b70869e0209f8daf90;p=brisk.git diff --git a/web/index.php b/web/index.php index e18625e..2b04597 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; @@ -39,11 +43,40 @@ if (DEBUGGING == "local" && $_SERVER['REMOTE_ADDR'] != '127.0.0.1') { log_load("index.php"); + +function poll_dom() { + GLOBAL $G_with_poll, $G_poll_title, $G_poll_entries; + + if ($G_with_poll) { + $ret = sprintf('
+ + + +'); + return ($ret); + } + else + return ''; +} + function main() { GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local; - GLOBAL $sess, $name, $table_idx, $table_token, $BRISK_SHOWHTML, $BRISK_DEBUG, $_SERVER; - + GLOBAL $G_with_sidebanner, $G_sidebanner; + GLOBAL $G_with_sidebanner2, $G_sidebanner2; + GLOBAL $G_with_poll; + 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 +121,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 +162,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 +187,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 +201,7 @@ function main() $tables .= sprintf('
', $i); $tables .= '
'; $tables .= '
'; @@ -145,43 +209,80 @@ 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 .= '
'; } - $altout_propag = array( array ( 'id' => 'btn_altout', + $altout_sponsor_arr = array( array ( 'id' => 'btn_altout', 'url' => 'http://www.alternativeoutput.it', 'content' => 'img/altout80x15.png', - 'content_big' => 'img/altout80x15.png'), + 'content_big' => 'img/logotxt_banner.png'), array ( 'id' => 'btn_virtualsky', 'url' => 'http://virtualsky.alternativeoutput.it', 'content' => 'img/virtualsky80x15a.gif', - 'content_big' => 'img/virtualsky_big.png') + 'content_big' => 'img/virtualsky_big.png'), + array ( 'id' => 'btn_dynamica', + 'url' => 'http://www.dynamica.it', + 'content' => 'img/dynamica.png', + 'content_big' => 'img/dynamica_big.png') ); - + + $altout_support_arr = array( array ( 'id' => 'btn_brichi', + 'url' => 'http://www.briscolachiamata.it', + 'content' => 'img/brichi.png', + 'content_big' => 'img/brichi_big.png'), + array ( 'id' => 'btn_foroli', + 'url' => 'http://www.forumolimpia.it', + 'content' => 'img/forumolimpia.gif', + 'content_big' => 'img/forumolimpia_big.png' ) ); + + + + $altout_support = ""; + $altout_support_big = ""; + for ($i = 0 ; $i < 3 ; $i++) { + $ii = ($i < 2 ? $i : 0); + + $altout_support .= sprintf('
', + $i * 20, $altout_support_arr[$ii]['url'], + $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content']); + + $altout_support_big .= sprintf('', + $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content_big']); + } + + // seed with microseconds since last "whole" second - srand ((double) microtime() * 1000000); - // $randval = rand(0,count($altout_propag)-1); - $randval = 1; - $altout_carousel = sprintf('', - $altout_propag[$randval]['url'], - $altout_propag[$randval]['id'], - $altout_propag[$randval]['content']); - - $altout_carousel_big = sprintf('', - $altout_propag[$randval]['id'], - $altout_propag[$randval]['content_big']); - + // srand ((double) microtime() * 1000000); + // $randval = rand(0,count($altout_sponsor_arr)-1); + $altout_sponsor = ""; + $altout_sponsor_big = ""; + for ($i = 0 ; $i < 4 ; $i++) { + $ii = ($i < 3 ? $i : 0); + + $altout_sponsor .= sprintf('
', + $i * 20, $altout_sponsor_arr[$ii]['url'], + $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content']); + + $altout_sponsor_big .= sprintf('', + $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content_big']); + } + + + + $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt"); if ($brisk_donate == FALSE) $brisk_donate = ""; - + /* MLANG: "briscola chiamata in salsa ajax", */ $brisk_header_form = '
@@ -233,15 +334,19 @@ google_color_url = "000000";
'; +/* MLANG: ALL THE VERTICAL MENU */ $brisk_vertical_menu = '
- + +
+sponsored by:
+
+
+
'.$altout_sponsor.'
+
+
+'.$altout_sponsor_big.' +
+
+supported by:
+
+
+
'.$altout_support.'
+ +
+
+
+'.$altout_support_big.'
-


-sponsored by:

'.$altout_carousel.'
-

-supported by:

-
-

+ +


%s %s - - - -'.$altout_carousel_big.'
'; +
'; /* Templates. */ if ($ACTION == 'login') { @@ -328,6 +516,7 @@ supported by:

Brisk + @@ -336,20 +525,41 @@ supported by:

+ + + + + \n"); printf($brisk_vertical_menu, '', ''); - printf(""); + + 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(""); ?> - +



-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,24 +648,35 @@ Digita il tuo nickname per accedere ai tavoli della briscola.
+ + + + \n"); - printf($brisk_vertical_menu, '



', + /* 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(""); ?> @@ -483,17 +771,56 @@ else {
-Chat
+Chat
+
- +
+ +
+
+ Garantisci per un tuo conoscente: +

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

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