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(); } }
public function getJSON() { $users = $this->getRequestUsers(); $r = new UserEditResponse(); $r->setUsers($users); $r->outputJSON(); }
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(); }