95 lines
2.6 KiB
PHTML
95 lines
2.6 KiB
PHTML
<?php
|
|
|
|
use Icinga\Data\Extensible;
|
|
use Icinga\Data\Reducible;
|
|
|
|
if (! $this->compact): ?>
|
|
<div class="controls">
|
|
<?= $this->tabs; ?>
|
|
<div class="grid">
|
|
<?= $this->limiter ?>
|
|
<?= $this->paginator ?>
|
|
<?= $this->sortBox ?>
|
|
</div>
|
|
<div>
|
|
<?= $this->backendSelection; ?>
|
|
<?= $this->filterEditor; ?>
|
|
</div>
|
|
</div>
|
|
<?php endif ?>
|
|
<div class="content groups">
|
|
<?php
|
|
|
|
if (! isset($backend)) {
|
|
echo $this->translate('No backend found which is able to list groups') . '</div>';
|
|
return;
|
|
} else {
|
|
$extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible;
|
|
$reducible = $this->hasPermission('config/authentication/groups/remove') && $backend instanceof Reducible;
|
|
}
|
|
?>
|
|
|
|
<?php if ($extensible): ?>
|
|
<?= $this->qlink(
|
|
$this->translate('Add a New User Group') ,
|
|
'group/add',
|
|
array('backend' => $backend->getName()),
|
|
array(
|
|
'class' => 'button-link',
|
|
'data-base-target' => '_next',
|
|
'icon' => 'plus',
|
|
'title' => $this->translate('Create a new user group')
|
|
)
|
|
) ?>
|
|
<?php endif ?>
|
|
|
|
<?php
|
|
// @TODO(el): Remove $firstRow stuff
|
|
$firstRow = true;
|
|
foreach ($groups as $group): ?>
|
|
<?php if ($firstRow): ?>
|
|
<?php $firstRow = false; ?>
|
|
<table data-base-target="_next" class="table-row-selectable common-table">
|
|
<thead>
|
|
<tr>
|
|
<th class="group-name"><?= $this->translate('Group'); ?></th>
|
|
<?php if ($reducible): ?>
|
|
<th class="group-remove"><?= $this->translate('Remove'); ?></th>
|
|
<?php endif ?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php endif ?>
|
|
<tr>
|
|
<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>
|
|
<?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 ?>
|
|
</tr>
|
|
<?php endforeach ?>
|
|
<?php if ($groups->hasResult()): ?>
|
|
</tbody>
|
|
</table>
|
|
<?php else: ?>
|
|
<p><?= $this->translate('No groups found matching the filter'); ?></p>
|
|
<?php endif ?>
|
|
</div>
|