2015-05-20 14:07:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Icinga\Data\Extensible;
|
|
|
|
use Icinga\Data\Reducible;
|
|
|
|
|
|
|
|
if (! $this->compact): ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
<div class="controls">
|
|
|
|
<?= $this->tabs; ?>
|
|
|
|
<?= $this->sortBox; ?>
|
|
|
|
<?= $this->limiter; ?>
|
|
|
|
<?= $this->paginator; ?>
|
2015-05-08 09:56:07 +02:00
|
|
|
<div>
|
|
|
|
<?= $this->backendSelection; ?>
|
|
|
|
<?= $this->filterEditor; ?>
|
|
|
|
</div>
|
2015-05-05 09:24:28 +02:00
|
|
|
</div>
|
|
|
|
<?php endif ?>
|
2015-05-20 14:07:24 +02:00
|
|
|
<div class="content groups">
|
2015-05-05 09:24:28 +02:00
|
|
|
<?php
|
|
|
|
|
2015-06-08 13:28:12 +02:00
|
|
|
if (! isset($backend)) {
|
2015-05-05 09:24:28 +02:00
|
|
|
echo $this->translate('No backend found which is able to list groups') . '</div>';
|
|
|
|
return;
|
2015-05-20 14:07:24 +02:00
|
|
|
} else {
|
2015-06-02 09:04:34 +02:00
|
|
|
$extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible;
|
|
|
|
$reducible = $this->hasPermission('config/authentication/groups/remove') && $backend instanceof Reducible;
|
2015-05-05 09:24:28 +02:00
|
|
|
}
|
|
|
|
|
2015-08-03 16:18:37 +02:00
|
|
|
$firstRow = true;
|
|
|
|
foreach ($groups as $group): ?>
|
|
|
|
<?php if ($firstRow): ?>
|
|
|
|
<?php $firstRow = false; ?>
|
2015-06-17 17:28:28 +02:00
|
|
|
<table data-base-target="_next" class="action group-list alternating">
|
2015-05-05 09:24:28 +02:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="group-name"><?= $this->translate('Group'); ?></th>
|
2015-05-20 14:07:24 +02:00
|
|
|
<?php if ($reducible): ?>
|
|
|
|
<th class="group-remove"><?= $this->translate('Remove'); ?></th>
|
|
|
|
<?php endif ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2015-08-03 16:18:37 +02:00
|
|
|
<?php endif ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
<tr>
|
2015-05-20 16:17:37 +02:00
|
|
|
<td class="group-name"><?= $this->qlink($group->group_name, 'group/show', array(
|
|
|
|
'backend' => $backend->getName(),
|
|
|
|
'group' => $group->group_name
|
|
|
|
), array(
|
|
|
|
'title' => sprintf($this->translate('Show detailed information for group %s'), $group->group_name)
|
|
|
|
)); ?></td>
|
2015-05-20 14:07:24 +02:00
|
|
|
<?php if ($reducible): ?>
|
|
|
|
<td class="group-remove">
|
|
|
|
<?= $this->qlink(
|
|
|
|
null,
|
|
|
|
'group/remove',
|
|
|
|
array(
|
|
|
|
'backend' => $backend->getName(),
|
|
|
|
'group' => $group->group_name
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => sprintf($this->translate('Remove group %s'), $group->group_name),
|
|
|
|
'icon' => 'trash'
|
|
|
|
)
|
|
|
|
); ?>
|
|
|
|
</td>
|
|
|
|
<?php endif ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
</tr>
|
2015-08-03 16:18:37 +02:00
|
|
|
<?php endforeach ?>
|
|
|
|
<?php if ($groups->hasResult()): ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2015-05-20 14:07:24 +02:00
|
|
|
<?php else: ?>
|
|
|
|
<p><?= $this->translate('No groups found matching the filter'); ?></p>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php if ($extensible): ?>
|
|
|
|
<?= $this->qlink($this->translate('Add a new group'), 'group/add', array('backend' => $backend->getName()), array(
|
|
|
|
'icon' => 'plus',
|
|
|
|
'data-base-target' => '_next',
|
|
|
|
'class' => 'group-add'
|
|
|
|
)); ?>
|
|
|
|
<?php endif ?>
|
2015-05-05 09:24:28 +02:00
|
|
|
</div>
|