X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Findex.php;h=80ed79172c395355e9d8d3ec539d8333de9ae91e;hb=0d5b50627bcf776d3c2411fb91c01e8cc4349d59;hp=8cf1eee7bf90f4577f53292fda6fc02ffc15d94d;hpb=380e4f95319a328524a764956fb802d991864bf7;p=brisk.git diff --git a/web/index.php b/web/index.php index 8cf1eee..80ed791 100644 --- a/web/index.php +++ b/web/index.php @@ -2,7 +2,7 @@ /* * brisk - index.php * - * Copyright (C) 2006-2011 Matteo Nastasi + * Copyright (C) 2006-2012 Matteo Nastasi * mailto: nastasi@alternativeoutput.it * matteo.nastasi@milug.org * web: http://www.alternativeoutput.it @@ -20,13 +20,7 @@ * not, write to the Free Software Foundation, Inc, 59 Temple Place - * Suite 330, Boston, MA 02111-1307, USA. * - - -TODO: - - header - - setcookie - - gestire per intero la var globale di output -*/ + */ require_once("Obj/brisk.phh"); require_once("Obj/auth.phh"); @@ -213,7 +207,7 @@ function carousel_top() return (sprintf('', $rn)); } -function index_main(&$room, &$header_out, $addr, $get, $post, $cookie) +function index_main(&$room, $transp_type, &$header_out, $addr, $get, $post, $cookie) { GLOBAL $G_with_donors, $G_donors_cur, $G_donors_all; GLOBAL $G_with_topbanner, $G_topbanner, $G_is_local; @@ -233,8 +227,7 @@ function index_main(&$room, &$header_out, $addr, $get, $post, $cookie) unset ($table_idx); if (($table_token = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE) unset ($table_token); - - + // Use of proxies isn't allowed. if (!$G_is_local && is_proxy($addr)) { return FALSE; @@ -260,8 +253,10 @@ function index_main(&$room, &$header_out, $addr, $get, $post, $cookie) if (($user = &$room->get_user($sess, &$idx)) != FALSE) { log_main("user stat: ".$user->stat); if ($user->stat == "table") { - setcookie("table_token", $user->table_token, $curtime + 31536000); - setcookie("table_idx", $user->table, $curtime + 31536000); + $cookies = new Cookies(); + $cookies->add("table_token", $user->table_token, $curtime + 31536000); + $cookies->add("table_idx", $user->table, $curtime + 31536000); + $header_out['cookies'] = $cookies; $header_out['Location'] = "briskin5/index.php"; return TRUE; } @@ -280,7 +275,7 @@ function index_main(&$room, &$header_out, $addr, $get, $post, $cookie) $room->garbage_manager(TRUE); /* try login */ - if (($user = $room->add_user(&$sess, &$idx, $name, $pass_private, $addr)) != FALSE) { + if (($user = $room->add_user(&$sess, &$idx, $name, $pass_private, $addr, $cookie)) != FALSE) { $ACTION = "room"; if ($idx < 0) { $idx = -$idx - 1; @@ -291,9 +286,11 @@ function index_main(&$room, &$header_out, $addr, $get, $post, $cookie) // recovery lost game if ($user->stat == "table") { - setcookie("table_token", $user->table_token, $curtime + 31536000); - setcookie("table_idx", $user->table, $curtime + 31536000); - $header_out['Location'] = "Location: briskin5/index.php"; + $cookies = new Cookies(); + $cookies->add("table_token", $user->table_token, $curtime + 31536000); + $cookies->add("table_idx", $user->table, $curtime + 31536000); + $header_out['cookies'] = $cookies; + $header_out['Location'] = "briskin5/index.php"; return TRUE; } @@ -402,14 +399,18 @@ function index_main(&$room, &$header_out, $addr, $get, $post, $cookie) array ( 'id' => 'btn_foroli', 'url' => 'http://www.forumolimpia.it', 'content' => 'img/forumolimpia.gif', - 'content_big' => 'img/forumolimpia_big.png' ) ); + 'content_big' => 'img/forumolimpia_big.png' ), + array ( 'id'=> 'btn_niini', + 'url' => 'http://www.niinivirta.it', + 'content' => 'img/niinivirta.png', + 'content_big' => 'img/niinivirta_big.png') ); $altout_support = ""; $altout_support_big = ""; - for ($i = 0 ; $i < 3 ; $i++) { - $ii = ($i < 2 ? $i : 0); + for ($i = 0 ; $i < 4 ; $i++) { + $ii = ($i < 3 ? $i : 0); $altout_support .= sprintf('
', $i * 20, $altout_support_arr[$ii]['url'], @@ -510,7 +511,7 @@ google_color_url = "000000"; "
donatori
") ) : '').'
'.$banner_top_right.'
- + '; /* MLANG: ALL THE VERTICAL MENU */ @@ -846,7 +847,8 @@ supported by:


%s %s -
'; +
+'; /* Templates. */ if ($ACTION == 'login') { @@ -858,10 +860,10 @@ supported by:
- + - + @@ -882,7 +884,7 @@ supported by:
var gst = new globst(); var topbanner_sfx, topbanner_dx; var g_brow = null; - var hstm = null; + var xstm = null; var sess = "not_connected"; var spo_slide, sup_slide; @@ -890,7 +892,7 @@ supported by:
// alert(window.onbeforeunload); g_brow = get_browser_agent(); spo_slide = new sideslide($('spon_caro'), 80, 20); - sup_slide = new sideslide($('supp_caro'), 60, 20); + sup_slide = new sideslide($('supp_caro'), 80, 20); login_init(); - + - + @@ -1028,7 +1030,7 @@ echo "$body"; ?> window.onload = function() { g_brow = get_browser_agent(); spo_slide = new sideslide($('spon_caro'), 80, 20); - sup_slide = new sideslide($('supp_caro'), 60, 20); + sup_slide = new sideslide($('supp_caro'), 80, 20); sess = ""; -hstm = new http_streaming(window, null /* console*/ , gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd_ifra.php', function(com){eval(com);}); - hstm.hbit_set(heartbit); +xstm = new xynt_streaming(window, "", null /* console */, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd_ifra.php', function(com){eval(com);}); + xstm.hbit_set(heartbit); tra = new train($('room_tit')); window.onunload = onunload_cb; window.onbeforeunload = onbeforeunload_cb; @@ -1066,9 +1068,10 @@ hstm = new http_streaming(window, null /* console*/ , gst, 'index_php', 'sess', $("proflashext").innerHTML = ""; // console.log("session from main: "+sess); - hstm.start(); + xstm.start(); // alert("ARR LENGTH "+g_preload_img_arr.length); - setTimeout(preload_images, 0, g_preload_img_arr, g_imgct); + // FIXME: preload image will be fired by stream instead here + // setTimeout(preload_images, 0, g_preload_img_arr, g_imgct); $("txt_in").focus();