2015-10-01 10:03:29 +02:00
|
|
|
<?php
|
2015-05-20 16:17:37 +02:00
|
|
|
|
2015-05-21 16:38:47 +02:00
|
|
|
use Icinga\Data\Extensible;
|
2015-05-20 16:17:37 +02:00
|
|
|
use Icinga\Data\Updatable;
|
|
|
|
|
2021-02-18 08:52:57 +01:00
|
|
|
$extensible = $this->hasPermission('config/access-control/groups') && $backend instanceof Extensible;
|
2015-05-21 16:38:47 +02:00
|
|
|
|
2015-05-20 16:17:37 +02:00
|
|
|
$editLink = null;
|
2021-02-18 08:52:57 +01:00
|
|
|
if ($this->hasPermission('config/access-control/groups') && $backend instanceof Updatable) {
|
2015-05-20 16:17:37 +02:00
|
|
|
$editLink = $this->qlink(
|
|
|
|
null,
|
|
|
|
'group/edit',
|
|
|
|
array(
|
|
|
|
'backend' => $backend->getName(),
|
|
|
|
'group' => $group->group_name
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => sprintf($this->translate('Edit group %s'), $group->group_name),
|
|
|
|
'class' => 'group-edit',
|
|
|
|
'icon' => 'edit'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
2015-12-10 12:05:48 +01:00
|
|
|
<div class="controls separated">
|
2015-06-25 11:36:26 +02:00
|
|
|
<?php if (! $this->compact): ?>
|
2015-10-15 15:47:38 +02:00
|
|
|
<?= $tabs; ?>
|
2015-06-25 11:36:26 +02:00
|
|
|
<?php endif ?>
|
2015-10-15 15:47:38 +02:00
|
|
|
<h2 class="clearfix"><?= $this->escape($group->group_name) ?><span class="pull-right"><?= $editLink ?></span></h2>
|
|
|
|
<table class="name-value-table">
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Created at'); ?></th>
|
|
|
|
<td><?= $group->created_at === null ? '-' : $this->formatDateTime($group->created_at); ?></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Last modified'); ?></th>
|
|
|
|
<td><?= $group->last_modified === null ? '-' : $this->formatDateTime($group->last_modified); ?></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2015-06-25 11:36:26 +02:00
|
|
|
<?php if (! $this->compact): ?>
|
2015-10-15 15:47:38 +02:00
|
|
|
<h2><?= $this->translate('Members'); ?></h2>
|
2019-07-26 14:16:13 +02:00
|
|
|
<div class="sort-controls-container">
|
2015-10-15 15:47:38 +02:00
|
|
|
<?= $this->limiter; ?>
|
|
|
|
<?= $this->paginator; ?>
|
|
|
|
<?= $this->sortBox; ?>
|
|
|
|
</div>
|
|
|
|
<?= $this->filterEditor; ?>
|
2015-06-25 11:36:26 +02:00
|
|
|
<?php endif ?>
|
2015-06-09 08:23:06 +02:00
|
|
|
</div>
|
2015-10-15 15:47:38 +02:00
|
|
|
<div class="content">
|
2015-10-01 10:03:29 +02:00
|
|
|
<?php if ($extensible): ?>
|
|
|
|
<?= $this->qlink(
|
2015-10-15 15:47:38 +02:00
|
|
|
$this->translate('Add New Member'),
|
2015-10-01 10:03:29 +02:00
|
|
|
'group/addmember',
|
|
|
|
array(
|
2015-10-15 15:47:38 +02:00
|
|
|
'backend' => $backend->getName(),
|
|
|
|
'group' => $group->group_name
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'icon' => 'plus',
|
|
|
|
'class' => 'button-link'
|
2015-10-01 10:03:29 +02:00
|
|
|
)
|
|
|
|
) ?>
|
|
|
|
<?php endif ?>
|
|
|
|
|
2015-10-15 15:47:38 +02:00
|
|
|
<?php if (! $members->hasResult()): ?>
|
2015-06-09 08:23:06 +02:00
|
|
|
<p><?= $this->translate('No group member found matching the filter'); ?></p>
|
2015-10-01 10:03:29 +02:00
|
|
|
</div>
|
2015-10-15 15:47:38 +02:00
|
|
|
<?php return; endif ?>
|
|
|
|
|
2015-11-13 15:21:07 +01:00
|
|
|
<table data-base-target="_next" class="table-row-selectable common-table">
|
2015-10-15 15:47:38 +02:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Username'); ?></th>
|
|
|
|
<?php if (isset($removeForm)): ?>
|
|
|
|
<th><?= $this->translate('Remove'); ?></th>
|
|
|
|
<?php endif ?>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($members as $member): ?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<?php if (
|
2021-02-18 08:52:57 +01:00
|
|
|
$this->hasPermission('config/access-control/users')
|
2015-10-15 15:47:38 +02:00
|
|
|
&& ($userBackend = $backend->getUserBackendName($member->user_name)) !== null
|
|
|
|
): ?>
|
|
|
|
<?= $this->qlink($member->user_name, 'user/show', array(
|
|
|
|
'backend' => $userBackend,
|
|
|
|
'user' => $member->user_name
|
|
|
|
), array(
|
|
|
|
'title' => sprintf($this->translate('Show detailed information about %s'), $member->user_name)
|
|
|
|
)); ?>
|
|
|
|
<?php else: ?>
|
|
|
|
<?= $this->escape($member->user_name); ?>
|
|
|
|
<?php endif ?>
|
|
|
|
</td>
|
|
|
|
<?php if (isset($removeForm)): ?>
|
|
|
|
<td class="icon-col" data-base-target="_self">
|
|
|
|
<?php $removeForm->getElement('user_name')->setValue($member->user_name); echo $removeForm; ?>
|
|
|
|
</td>
|
|
|
|
<?php endif ?>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2015-10-01 10:03:29 +02:00
|
|
|
</div>
|