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 <lfleischer@archlinux.org>
This commit is contained in:
Gordian Edenhofer 2015-06-18 21:28:17 +02:00 committed by Lukas Fleischer
parent d841357d7f
commit 6395a5d5b8
2 changed files with 11 additions and 1 deletions

View file

@ -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 = "";
}