示例#1
0
 public function pre()
 {
     $this->user = Authenticate::session();
     if (!is_a($this->user, 'Kadmin') || $this->user->getType() != 'admin') {
         throw new Exception('Not Authorized', 401);
     }
     if (is_string($this->param2) && !empty($this->param2)) {
         $this->admin = Kadmin::getById($this->param2);
     }
 }