mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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:
parent
d841357d7f
commit
6395a5d5b8
2 changed files with 11 additions and 1 deletions
|
@ -42,6 +42,11 @@ html_header('AUR ' . __("Login"));
|
||||||
<p>
|
<p>
|
||||||
<input type="submit" class="button" value="<?php print __("Login"); ?>" />
|
<input type="submit" class="button" value="<?php print __("Login"); ?>" />
|
||||||
<a href="<?= get_uri('/passreset/') ?>">[<?= __('Forgot Password') ?>]</a>
|
<a href="<?= get_uri('/passreset/') ?>">[<?= __('Forgot Password') ?>]</a>
|
||||||
|
<?php if (in_request('referer') !== ""): ?>
|
||||||
|
<input id="id_referer" type="hidden" name="referer" value="<?= in_request('referer') ?>" />
|
||||||
|
<?php elseif (isset($_SERVER['HTTP_REFERER'])): ?>
|
||||||
|
<input id="id_referer" type="hidden" name="referer" value="<?= htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES) ?>" />
|
||||||
|
<?php endif; ?>
|
||||||
</p>
|
</p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -544,7 +544,12 @@ function try_login() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setcookie("AURSID", $new_sid, $cookie_time, "/", null, !empty($_SERVER['HTTPS']), true);
|
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 = "";
|
$login_error = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue