Skip to content

Commit

Permalink
Fixing reading members list
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel Stohn authored and Axel Stohn committed Mar 29, 2023
1 parent 436ee5b commit 36dc382
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ public function groupSubscribers()
$this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error'));
}
if(count($subscribers) < 1){
$this->response->type('json');
$this->response->statusCode(404);
//$this->response->body(json_encode(array('status' => 'ERROR', 'message' => 'NO ACCESS')));
$this->response->send();
$subscribers = '';
} elseif (count($subscribers) == 1 && $subscribers[0]['sourceId'] == "NoAccess") {
$this->response->type('json');
$this->response->statusCode(403);
//$this->response->body(json_encode(array('status' => 'ERROR', 'message' => 'NO ACCESS')));
Expand Down
5 changes: 5 additions & 0 deletions Lib/GrouperApiAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ public function getMembersInGroup(array $queryData)
$results = $this->http->sendRequest('POST', $connectionUrl, json_encode($usersToShow));

// Parse out relevant records to send front end
if(isset($results['WsGetMembersResults']['results'][0]['resultMetadata']['resultCode']) && $results['WsGetMembersResults']['results'][0]['resultMetadata']['resultCode'] != NULL){
if ($results['WsGetMembersResults']['results'][0]['resultMetadata']['resultCode'] == 'GROUP_NOT_FOUND'){
return array(array("sourceId" => "NoAccess", "name" => "", "id" => ""));
}
}
if (isset($results['WsGetMembersResults']['results'][0]['wsSubjects']) && $results['WsGetMembersResults']['results'][0]['wsSubjects'] != NULL) {
return $results['WsGetMembersResults']['results'][0]['wsSubjects'];
}
Expand Down

0 comments on commit 36dc382

Please sign in to comment.