示例#1
0
文件: Articles.php 项目: FTTA/devels
 public function before()
 {
     parent::before();
     if (!$this->is_logged) {
         die(json_encode(['status' => 'error', 'message' => 'Login please'], JSON_UNESCAPED_UNICODE));
     }
     $this->is_admin = $this->current_user['role_id'] == AuthModule::UR_ADMIN;
 }
示例#2
0
文件: Users.php 项目: FTTA/devels
 public function before()
 {
     parent::before();
     /*
             $this->is_logged    = Auth::check();
             $this->current_user = null;
     
             if ($this->is_logged)
             {
                 $this->current_user = Auth::get_profile_fields();
                 $this->current_user['id'] = Auth::get('id');
                 $this->current_user['username'] = Auth::get('username');
             }*/
     if (!$this->is_logged) {
         die(json_encode(['status' => 'error', 'message' => 'Login please'], JSON_UNESCAPED_UNICODE));
     }
     $this->is_admin = $this->current_user['role_id'] == AuthModule::UR_ADMIN;
 }