summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorGordian Edenhofer <gordian.edenhofer@gmail.com>2015-06-18 21:28:17 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-06-27 13:04:03 +0200
commit6395a5d5b86ce4aca75a4eb246db77cd08ae0ffc (patch)
tree075c3a5be69e3438fd2d33abe97465266d6e5b22 /web/lib
parentd841357d7f68e2b5d763aeef1dc1ce050b6f11df (diff)
downloadaur-6395a5d5b86ce4aca75a4eb246db77cd08ae0ffc.tar.gz
aur-6395a5d5b86ce4aca75a4eb246db77cd08ae0ffc.tar.xz
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>
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/acctfuncs.inc.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php
index 993cd346..6b7d2275 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 = "";
}