public function __construct(ActionPage $page) { $this->page = $page; if (!$this->page->IsAuthenticated()) { $this->RedirectResume($this->GetResumeUrl()); die; } }
public function PageLoad() { $user = ServiceLocator::GetServer()->GetUserSession(); if (!$this->page->IsAuthenticated() || !$user->IsAdmin) { $this->RedirectResume(sprintf("%s%s?%s=%s", $this->page->path, Pages::LOGIN, QueryStringKeys::REDIRECT, urlencode($this->page->server->GetUrl()))); die; } $this->page->PageLoad(); }