PageFlush added, log_legal without remote address
[brisk.git] / web / index.php
index 587acd8..9fb6b3d 100644 (file)
@@ -220,7 +220,7 @@ function carousel_top()
     return (sprintf('<a target="_blank" href="http://shop.alternativeoutput.it"><img class="nobo" style="display: inline; border: 1px solid #808080;" src="img/briskshop%d.gif"></a>', $rn));
 }
 
-function index_main(&$room, &$header_out, $get, $post, $cookie)
+function index_main(&$room, &$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;
@@ -243,7 +243,7 @@ function index_main(&$room, &$header_out, $get, $post, $cookie)
     
     
     // Use of proxies isn't allowed.
-    if (!$G_is_local && is_proxy()) {
+    if (!$G_is_local && is_proxy($addr)) {
         return FALSE;
     }
 
@@ -287,14 +287,14 @@ function index_main(&$room, &$header_out, $get, $post, $cookie)
           
           $room->garbage_manager(TRUE);
           /* try login */
-          if (($user = $room->add_user(&$sess, &$idx, $name, $pass_private, $_SERVER['REMOTE_ADDR'])) != FALSE) {
+          if (($user = $room->add_user(&$sess, &$idx, $name, $pass_private, $addr)) != FALSE) {
               $ACTION = "room";
               if ($idx < 0) {
                   $idx = -$idx - 1;
                   $is_login = TRUE;
               }
               
-              log_legal($curtime, $user, "STAT:LOGIN", '');
+              log_legal($curtime, $addr, $user, "STAT:LOGIN", '');
               
               // recovery lost game
               if ($user->stat == "table") {
@@ -1058,7 +1058,7 @@ else {
 
 ?>
      sess = "<?php echo "$sess"; ?>";
-     hstm = new http_streaming(window, console, gst, 'index_php', 'sess', sess, $('sandbox'), 'index_rd_ifra.php', function(com){eval(com);});
+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);
      tra = new train($('room_tit'));
      window.onunload = onunload_cb;