public static function assertAdmin($c) { $ua = Model::load('UserAccess', null, false); if (self::$u->id < 1 || self::$u->getAuth(self::$u->id) < $ua->getLevel('admin')) { Session::down(); $c->redirect("user/login"); } }
public function logout() { if (1 || isset($_POST['logout'])) { $u = CurrentUser::getUser(); Session::down(); $this->logoutSuccess($u); $this->redirect(''); } }