X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex.php;h=d0f74ca7bf485554f378195055d95c959796142b;hb=5196a0be0d675ab6a03fa6a6c36aa8de01d67c48;hp=2cfa99e735de099e5ddf0330d2d21d3cc4a8ab76;hpb=c439ef4cbc91118f9caa1ba8c97d364e8011ce2e;p=brisk.git diff --git a/web/index.php b/web/index.php index 2cfa99e..d0f74ca 100644 --- a/web/index.php +++ b/web/index.php @@ -42,29 +42,28 @@ function main() $bri = &load_data(); /* Actions */ - if (isset($sess)) { + if (validate_sess($sess)) { $bri->garbage_manager(TRUE); - if (($user = &get_user(&$bri, $sess, &$idx)) != FALSE) { + if (($user = &$bri->get_user($sess, &$idx)) != FALSE) { if ($user->stat == "table") { header ("Location: table.php"); unlock_data($sem); exit; } - $ACTION = "table"; - } - else { - setcookie ("sess", "", time() - 3600); + $ACTION = "room"; } } - else if (isset($name)) { + + if ($ACTION == "login" && isset($name)) { $bri->garbage_manager(TRUE); /* try login */ $name = substr($name, 0, 12); - if (($user = &add_user(&$bri, &$sess, &$idx, $name)) != FALSE) { - $ACTION = "table"; + $name = str_replace(" ", "_", $name); + if (($user = &$bri->add_user(&$sess, &$idx, $name)) != FALSE) { + $ACTION = "room"; - setcookie ("sess", "", time() + 180); - standup_update(&$bri,&$user); + // setcookie ("sess", "", time() + 180); + $bri->standup_update(&$user); if (save_data(&$bri) == FALSE) { echo "ERRORE SALVATAGGIO\n"; @@ -84,13 +83,13 @@ function main() /* Rendering. */ if ($BRISK_DEBUG == "debugtable") { - $ACTION = "table"; + $ACTION = "room"; } else if ($BRISK_DEBUG == "debuglogin") { $ACTION = "login"; } - if ($ACTION == "table") { + if ($ACTION == "room") { $tables .= ''; for ($i = 0 ; $i < TABLES_N ; $i++) { if ($i % 4 == 0) @@ -165,6 +164,7 @@ supported by:

Digita il tuo nickname per accedere ai tavoli della briscola.

+ @@ -184,7 +184,7 @@ Digita il tuo nickname per accedere ai tavoli della briscola.

@@ -224,7 +224,7 @@ else { setTimeout(xhr_rd_poll, 0, sess); // alert("ARR LENGTH "+g_preload_img_arr.length); - setTimeout(preload_images, 0, g_preload_img_arr, g_imgct); + // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct); $("txt_in").focus();