Skip to content

Commit

Permalink
Updated subscriber list, pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Mar 9, 2021
1 parent cb23623 commit 47745d1
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 635 deletions.
20 changes: 18 additions & 2 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public function index() {
public function groupInfo() {
$name = urldecode($this->request->query['groupname']);

$this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId));

$this->set('title', _txt('pl.grouperlite.title.groupinfo'));

try {
Expand All @@ -123,6 +125,16 @@ public function groupInfo() {
$this->set('groupergroupsdetail', array());
$this->Flash->set(_txt('pl.grouperlite.message.flash.info-group-failed'), array('key' => 'error'));
}

try {
$groupMembers = $this->membersInGroup();
$this->set('groupergroupssubscribers', $groupMembers);
} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true));

$this->set('groupergroupssubscribers', array());
$this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error'));
}
}

/**
Expand All @@ -138,16 +150,20 @@ public function membersInGroup() {
'groupName' => $groupName
];

$details = [];

try {
$details = $this->GrouperGroup->membersInGroup($scope);
$this->set('membersingroup', $details);
// $this->set('membersingroup', $details);

} catch (Exception $e) {
CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true));

$this->set('membersingroup', array());
// $this->set('membersingroup', array());
$this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error'));
}

return $details;
}


Expand Down
7 changes: 6 additions & 1 deletion View/Elements/Components/groupattributes.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
</tr>
<?php endforeach; ?>
</tbody>
</table>
</table>
<?php if (count($attr) < 1) : ?>
<div class="alert alert-info">
<p class="lead mb-0 text-center">No attributes defined.</p>
</div>
<?php endif; ?>
2 changes: 1 addition & 1 deletion View/Elements/Components/subscriberList.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<?php foreach ($subscribers as $sub) : ?>
<tr>
<td><?php echo $sub['name']; ?></td>
<td><?php echo $sub['email']; ?></td>
<td><?php echo $sub['id']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
Expand Down
Loading

0 comments on commit 47745d1

Please sign in to comment.