/** * Checks if method requires login * * @param $method */ protected function checkMethodForLoginNeed($method) { if (in_array($method, $this->loginRequired)) { $this->request->checkLoggedIn(); } }
/** * Checks if method requires login and if true, * checks logged in status. * * @param $method * @throws AuthException if is not logged in */ protected function checkMethodForLoginRequired($method) { if (in_array($method, $this->loginRequired) && !$this->request->isLoggedIn()) { throw new AuthException("You must log in before."); } }