Redirect wishlists to login if user is not logged in

This commit is contained in:
grandeljay 2022-11-28 13:50:06 +01:00
parent 4fc8c9f3c1
commit 4896b37d87
2 changed files with 8 additions and 8 deletions

View file

@ -149,13 +149,6 @@ class Page
*/ */
$user = isset($_SESSION['user']->id) ? $_SESSION['user'] : new User(); $user = isset($_SESSION['user']->id) ? $_SESSION['user'] : new User();
/**
* Power
*/
if (isset($user->power) && $user->power < $this->power && 0 !== $this->power) {
redirect(Page::PAGE_POWER . '&required=' . $this->power);
}
/** /**
* Login * Login
*/ */
@ -167,6 +160,13 @@ class Page
redirect(Page::PAGE_LOGIN); redirect(Page::PAGE_LOGIN);
} }
/**
* Power
*/
if (isset($user->power) && $user->power < $this->power && 0 !== $this->power) {
redirect(Page::PAGE_POWER . '&required=' . $this->power);
}
/** /**
* Update * Update
*/ */

View file

@ -8,7 +8,7 @@
namespace wishthis; namespace wishthis;
$page = new Page(__FILE__, __('My lists')); $page = new Page(__FILE__, __('My lists'), 1);
$page->header(); $page->header();
$page->bodyStart(); $page->bodyStart();
$page->navigation(); $page->navigation();