Beispiel #1
0
 public function afterLogin($fromCookie)
 {
     if ($fromCookie) {
         Yii::app()->user =& $this;
     }
     $oUser = User::model()->findByPk($this->id);
     $this->roleid = $oUser->roleid;
     $this->rolename = $oUser->Role->name;
     $this->roletype = $oUser->Role->type;
     $this->realname = $oUser->realname;
     $this->status = $oUser->status;
     $this->lang = $oUser->lang;
     $this->view_all = $oUser->view_all;
     $model = UserRole::model()->findByPk($this->roleid);
     if ($oUser->Role->purview == 'admin') {
         $this->perm = Module::getUserPerm('admin');
     } else {
         $this->perm = Module::getUserPerm(json_decode($model->purview, true));
     }
     $this->publishers = UserResource::getUserPublisher();
 }
Beispiel #2
0
 public function getUsers()
 {
     $userResource = new UserResource($this->request);
     $users = $userResource->getAll();
     return $users;
 }