From 6395a5d5b86ce4aca75a4eb246db77cd08ae0ffc Mon Sep 17 00:00:00 2001 From: Gordian Edenhofer Date: Thu, 18 Jun 2015 21:28:17 +0200 Subject: Redirect at previous page after a successful login After the user was authenticated a redirect to the site which linked the user to the login page is done. This fixes FS#32481. Signed-off-by: Lukas Fleischer --- web/lib/acctfuncs.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web/lib/acctfuncs.inc.php') diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index 993cd34..6b7d227 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -544,7 +544,12 @@ function try_login() { } setcookie("AURSID", $new_sid, $cookie_time, "/", null, !empty($_SERVER['HTTPS']), true); - header("Location: " . get_uri('/')); + + $referer = in_request('referer'); + if (strpos($referer, aur_location()) !== 0) { + $referer = '/'; + } + header("Location: " . get_uri($referer)); $login_error = ""; } -- cgit v1.2.3-70-g09d2