예제 #1
0
 public function getUsersJSON()
 {
     $dh = Loader::helper('concrete/user');
     if ($dh->canAccessUserSearchInterface()) {
         if (!is_array($_REQUEST['uID'])) {
             $users[] = $_REQUEST['uID'];
         } else {
             $users = $_REQUEST['uID'];
         }
         $users = array_filter(array_map(function ($item) {
             $u = UserInfo::getByID(intval($item));
             //Could not find permission with key 'view_user'
             // $uip = new Permissions($u);
             // if ($uip->canViewUser()){
             //     return $u;
             // }else{
             //     return false;
             // }
             return $u;
         }, $users));
         $r = new UserEditResponse();
         if (count($users) == 1) {
             $r->setUser($users[0]);
         } else {
             $r->setUsers($users);
         }
         $r->outputJSON();
     }
 }
예제 #2
0
파일: user.php 프로젝트: ceko/concrete5-1
 public function getJSON()
 {
     $users = $this->getRequestUsers();
     $r = new UserEditResponse();
     $r->setUsers($users);
     $r->outputJSON();
 }
예제 #3
0
 public function clearAttribute()
 {
     $ur = new UserEditResponse();
     $ak = UserAttributeKey::getByID($_REQUEST['akID']);
     if ($this->validateAction()) {
         $this->populateUsers();
         if ($this->canEdit && in_array($ak->getAttributeKeyID(), $this->allowedEditAttributes)) {
             foreach ($this->users as $ui) {
                 $ui->clearAttribute($ak);
                 $ui->reindex();
             }
             $ur->setUsers($this->users);
             $ur->setAdditionalDataAttribute('value', false);
             $ur->setMessage(t('Attributes cleared successfully.'));
         } else {
             throw new Exception(t("You don't have access to update this attribute."));
         }
     }
     $ur->outputJSON();
 }