Redirect to previous page after login
This commit is contained in:
parent
865236fa7e
commit
dbffab099d
2 changed files with 7 additions and 1 deletions
|
@ -148,11 +148,13 @@ class Page
|
|||
'changelog',
|
||||
'wishlist',
|
||||
);
|
||||
|
||||
if (
|
||||
!isset($_SESSION['user'])
|
||||
&& isset($_SESSION['_GET']['page'])
|
||||
&& !in_array($_SESSION['_GET']['page'], $ignorePower)
|
||||
) {
|
||||
$_SESSION['REDIRECT_URL'] = $_SERVER['REQUEST_URI'];
|
||||
redirect(Page::PAGE_LOGIN);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,8 +40,12 @@ if (isset($_POST['login'], $_POST['email'], $_POST['password'])) {
|
|||
}
|
||||
|
||||
if (isset($_SESSION['user'])) {
|
||||
if (isset($_SESSION['REDIRECT_URL'])) {
|
||||
redirect($_SESSION['REDIRECT_URL']);
|
||||
} else {
|
||||
redirect(Page::PAGE_HOME);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset
|
||||
|
|
Loading…
Reference in a new issue