properly handle redirecting back to requested page after logging in (closes #302)
This commit is contained in:
parent
8122dae505
commit
6615cc366c
2 changed files with 8 additions and 13 deletions
14
backend.php
14
backend.php
|
@ -82,18 +82,8 @@
|
||||||
if ($op == "rpc" || $op == "viewfeed" || $op == "view") {
|
if ($op == "rpc" || $op == "viewfeed" || $op == "view") {
|
||||||
print_error_xml(6); die;
|
print_error_xml(6); die;
|
||||||
} else {
|
} else {
|
||||||
print "
|
header("Location: tt-rss.php?return=" .
|
||||||
<html><body>
|
urlencode($_SERVER['REQUEST_URI']));
|
||||||
<p>Error: Not logged in.</p>
|
|
||||||
<script type=\"text/javascript\">
|
|
||||||
if (parent.window != 'undefined') {
|
|
||||||
parent.window.location = \"tt-rss.php\";
|
|
||||||
} else {
|
|
||||||
window.location = \"tt-rss.php\";
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body></html>
|
|
||||||
";
|
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1985,7 +1985,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
header("Location: " . $_SERVER["REQUEST_URI"]);
|
if ($_REQUEST['return']) {
|
||||||
|
header("Location: " . $_REQUEST['return']);
|
||||||
|
} else {
|
||||||
|
header("Location: " . $_SERVER["REQUEST_URI"]);
|
||||||
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue