From: Andrew Dolgov Date: Tue, 18 Jan 2011 13:47:52 +0000 (+0300) Subject: properly handle redirecting back to requested page after logging in (closes #302) X-Git-Tag: 1.5.1~3 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=6615cc366c7d58b2f3291a76d6c299a114155899;p=tt-rss.git properly handle redirecting back to requested page after logging in (closes #302) --- diff --git a/backend.php b/backend.php index 962453c4..c7bd6180 100644 --- a/backend.php +++ b/backend.php @@ -82,18 +82,8 @@ if ($op == "rpc" || $op == "viewfeed" || $op == "view") { print_error_xml(6); die; } else { - print " - -

Error: Not logged in.

- - - "; + header("Location: tt-rss.php?return=" . + urlencode($_SERVER['REQUEST_URI'])); } exit; } diff --git a/functions.php b/functions.php index 64269aad..0bbefd58 100644 --- a/functions.php +++ b/functions.php @@ -1985,7 +1985,12 @@ } } - header("Location: " . $_SERVER["REQUEST_URI"]); + if ($_REQUEST['return']) { + header("Location: " . $_REQUEST['return']); + } else { + header("Location: " . $_SERVER["REQUEST_URI"]); + } + exit; return;