From: Matteo Nastasi Date: Wed, 3 Oct 2012 20:33:28 +0000 (+0200) Subject: Location management added X-Git-Tag: v4.0.0~46 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=380e4f95319a328524a764956fb802d991864bf7;p=brisk.git Location management added --- diff --git a/web/Obj/sac-a-push.phh b/web/Obj/sac-a-push.phh index 1151ea1..70ae6bf 100644 --- a/web/Obj/sac-a-push.phh +++ b/web/Obj/sac-a-push.phh @@ -105,9 +105,13 @@ function gpcs_var($name, $get, $post, $cookie) function headers_render($header, $len) { - $s = ""; - $s .= "HTTP/1.1 200 OK\r\n"; + if (isset($header['Location'])) { + return sprintf("HTTP/1.1 302 OK\r\nLocation: %s\r\n\r\n", $header['Location']); + } + else { + $s .= "HTTP/1.1 200 OK\r\n"; + } if (!isset($header['Date'])) $s .= sprintf("Date: %s\r\n", date(DATE_RFC822)); if (!isset($header['Connection'])) diff --git a/web/Obj/user.phh b/web/Obj/user.phh index 9240474..761c9cc 100644 --- a/web/Obj/user.phh +++ b/web/Obj/user.phh @@ -637,7 +637,7 @@ class User { /* INDEX_RD_IFRA PORT */ - static function blocking_error($is_unrecoverable) + protected function blocking_error($is_unrecoverable) { GLOBAL $is_page_streaming; @@ -822,7 +822,7 @@ class User { return ($ret); } // function maincheck (... -static function stream_fini($is_unrecoverable) +public static function stream_fini($is_unrecoverable) { GLOBAL $G_four_rnd_string; diff --git a/web/briskin5/Obj/briskin5.phh b/web/briskin5/Obj/briskin5.phh index c5ad7ce..a9813e5 100644 --- a/web/briskin5/Obj/briskin5.phh +++ b/web/briskin5/Obj/briskin5.phh @@ -718,7 +718,37 @@ class Bin5_user extends User { return ($ret); } - static function blocking_error($is_unrecoverable) +public static function stream_fini($is_unrecoverable) +{ + GLOBAL $G_four_rnd_string; + + printf("xXx user::stream_fini\n"); + + // IF IFRAME THEN: + $body = ""; + $body .= sprintf(" + + + + + +"); + $body .= sprintf("\n", $G_four_rnd_string); + $body .= sprintf("", 0, escpush(self::blocking_error($is_unrecoverable)) ); + // ELSE IF XHR THEN: + // return (self::blocking_error($is_unrecoverable)); + return ($body); +} + + + protected function blocking_error($is_unrecoverable) { GLOBAL $is_page_streaming; diff --git a/web/index.php b/web/index.php index 1294ad6..8cf1eee 100644 --- a/web/index.php +++ b/web/index.php @@ -262,7 +262,7 @@ function index_main(&$room, &$header_out, $addr, $get, $post, $cookie) 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"; + $header_out['Location'] = "briskin5/index.php"; return TRUE; } $ACTION = "room";