/** * @return bool */ public function isAuth() { if (empty($this->auth_checker) || $this->isEmpty()) { return false; } /** * @var CheckAuthorization $this->auth_checker */ return $this->auth_checker->getResult(); }
public function userToggleSmsNotify() { $check_auth = new CheckAuthorization($this->getQemyDb()); $check_auth->check(true); $user = new User($this->getQemyDb(), $check_auth->getUserRow()); $user->setAuthChecker($check_auth); if (!$user->isAuth()) { Application::denied(); $this->setData(array('result' => false)); return $this; } $this->setData(array('result' => $user->toggleSmsEnabled())); return $this; }