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;
$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;
printf("COOKIE:\n");
print_r($cookie);
+ $addr = stream_socket_get_name($new_socket, TRUE);
+
switch ($path) {
case SITE_PREFIX:
case SITE_PREFIX."index.php":
$header_out = array();
ob_start();
- index_main($room, $header_out, $get, $post, $cookie);
+ index_main($room, $header_out, $addr, $get, $post, $cookie);
$content = ob_get_contents();
ob_end_clean();
// printf("OUT: [%s]\n", $G_content);
fclose($new_socket);
break;
case SITE_PREFIX."index_wr.php":
- $G_headers = "";
+ $header_out = array();
$addr = "";
- $ret = socket_getpeername($new_socket, $addr);
- // printf("RET: %d\n", $ret);
+ // $ret = socket_getpeername($new_socket, $addr);
+ printf("RET: %s\n", $addr);
// exit(123);
ob_start();
index_wr_main($room, $addr, $get, $post, $cookie);