diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 594f53b..6f24368 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -37,7 +37,7 @@ class GrouperGroupsController extends GrouperLiteAppController { public $helpers = array('Html', 'Form', 'Flash'); - public $components = array('Flash', 'Paginator'); + public $components = array('Flash', 'Paginator', 'RequestHandler'); public $name = 'GrouperGroups'; @@ -168,6 +168,36 @@ public function membersInGroup() { return $details; } + + /** + * Show all members of group in Grouper Group detail page + * Called from method GroupInfo + * + */ + public function groupSubscribers() { + $groupName = urldecode($this->request->query['groupname']); + + if ($this->request->is('ajax')) { + $ajax = true; + } + + //Set initial + $scope = [ + 'groupName' => 'ref:incommon-collab:' . $groupName . ':users' + ]; + + try { + $subscribers = $this->GrouperGroup->membersInGroup($scope); + + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); + + $this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error')); + } + + $this->set(compact('subscribers')); + $this->set('_serialize', 'subscribers'); + } /** @@ -294,6 +324,7 @@ public function groupMember() { return; } } + $this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl')); $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); } @@ -521,9 +552,10 @@ function isAuthorized() { $p['index'] = true; $p['groupinfo'] = true; - $p['membersInGroup'] = true; + $p['membersingroup'] = true; $p['groupowner'] = true; $p['groupmember'] = true; + $p['groupSubscribers'] = true; $p['groupoptin'] = true; $p['emaillistsoptin'] = true; $p['emaillistsmember'] = true; diff --git a/View/Elements/Components/subscriberList.ctp b/View/Elements/Components/subscriberList.ctp index 83f92ad..e1fa91b 100644 --- a/View/Elements/Components/subscriberList.ctp +++ b/View/Elements/Components/subscriberList.ctp @@ -18,6 +18,7 @@