From 1c247bc4073451ad156ecedfbd2f7ebe73b56c12 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 18 Aug 2015 22:01:18 +0200 Subject: Fix redirect URI when using multiple tabs If we store only the last called URI in the session we can't support multiple browser tabs that all need to log in again. Fix this by storing the URI in the URL. Also change a trim() to ltrim() so that the URI string we store keeps it's trailing slash. Signed-off-by: Florian Pritz --- public_html/index.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'public_html/index.php') diff --git a/public_html/index.php b/public_html/index.php index f0c099478..de9d2a16c 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -221,7 +221,12 @@ try { if (is_cli_client()) { show_error(nl2br(htmlspecialchars($e->__toString())), $e->get_http_error_code()); } else { - redirect("user/login"); + $CI =& get_instance(); + $redirect_uri = $CI->uri->uri_string(); + if (isset($CI->data["redirect_uri"])) { + $redirect_uri = $CI->data["redirect_uri"]; + } + redirect("user/login?redirect_uri=".$redirect_uri); } } catch (\exceptions\PublicApiException $e) { show_error(nl2br(htmlspecialchars($e->__toString())), $e->get_http_error_code()); -- cgit v1.2.3-24-g4f1b