parent
49a7084b6a
commit
1728d5a949
|
@ -4,72 +4,76 @@ use Icinga\Data\Reducible;
|
||||||
|
|
||||||
if (! $this->compact): ?>
|
if (! $this->compact): ?>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<?= $this->tabs ?>
|
<?= $this->tabs ?>
|
||||||
<?= $this->sortBox ?>
|
<?= $this->sortBox ?>
|
||||||
<?= $this->limiter ?>
|
<?= $this->limiter ?>
|
||||||
<?= $this->paginator ?>
|
<?= $this->paginator ?>
|
||||||
<div>
|
<div>
|
||||||
<?= $this->backendSelection ?>
|
<?= $this->backendSelection ?>
|
||||||
<?= $this->filterEditor ?>
|
<?= $this->filterEditor ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<div class="content users">
|
<div class="content users">
|
||||||
|
<?php if (! isset($backend)): ?>
|
||||||
|
<p><?= $this->translate('No backend found which is able to list users.') ?></p>
|
||||||
|
</div>
|
||||||
|
<?php return; endif ?>
|
||||||
|
<?php if (! $users->hasResult()): ?>
|
||||||
|
<p><?= $this->translate('No users found matching the filter.') ?></p>
|
||||||
|
</div>
|
||||||
|
<?php return; endif ?>
|
||||||
<?php
|
<?php
|
||||||
if (! isset($backend)) {
|
$extensible = $this->hasPermission('config/authentication/users/add') && $backend instanceof Extensible;
|
||||||
echo $this->translate('No backend found which is able to list users') . '</div>';
|
$reducible = $this->hasPermission('config/authentication/users/remove') && $backend instanceof Reducible;
|
||||||
return;
|
|
||||||
} elseif (! $users->hasResult()) {
|
|
||||||
echo '<p>' . $this->translate('No users found matching the filter') . '</p>' . '</div>';
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
$extensible = $this->hasPermission('config/authentication/users/add') && $backend instanceof Extensible;
|
|
||||||
$reducible = $this->hasPermission('config/authentication/users/remove') && $backend instanceof Reducible;
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<table data-base-target="_next" class="action user-list alternating">
|
<table data-base-target="_next" class="action user-list alternating">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="user-name"><?= $this->translate('Username') ?></th>
|
<th class="user-name"><?= $this->translate('Username') ?></th>
|
||||||
<?php if ($reducible): ?>
|
<?php if ($reducible): ?>
|
||||||
<th class="user-remove"><?= $this->translate('Remove') ?></th>
|
<th class="user-remove"><?= $this->translate('Remove') ?></th>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($users as $user): ?>
|
<?php foreach ($users as $user): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="user-name"><?= $this->qlink($user->user_name, 'user/show', array(
|
<td class="user-name"><?= $this->qlink(
|
||||||
'backend' => $backend->getName(),
|
$user->user_name,
|
||||||
'user' => $user->user_name
|
'user/show',
|
||||||
), array(
|
array(
|
||||||
'title' => sprintf($this->translate('Show detailed information about %s'), $user->user_name)
|
'backend' => $backend->getName(),
|
||||||
)) ?></td>
|
'user' => $user->user_name
|
||||||
<?php if ($reducible): ?>
|
),
|
||||||
<td class="user-remove">
|
array(
|
||||||
<?= $this->qlink(
|
'title' => sprintf($this->translate('Show detailed information about %s'), $user->user_name)
|
||||||
null,
|
)
|
||||||
'user/remove',
|
) ?></td>
|
||||||
array(
|
<?php if ($reducible): ?>
|
||||||
'backend' => $backend->getName(),
|
<td class="user-remove"><?= $this->qlink(
|
||||||
'user' => $user->user_name
|
null,
|
||||||
),
|
'user/remove',
|
||||||
array(
|
array(
|
||||||
'title' => sprintf($this->translate('Remove user %s'), $user->user_name),
|
'backend' => $backend->getName(),
|
||||||
'icon' => 'trash'
|
'user' => $user->user_name
|
||||||
)
|
),
|
||||||
) ?>
|
array(
|
||||||
</td>
|
'title' => sprintf($this->translate('Remove user %s'), $user->user_name),
|
||||||
<?php endif ?>
|
'icon' => 'trash'
|
||||||
</tr>
|
)
|
||||||
<?php endforeach ?>
|
) ?></td>
|
||||||
</tbody>
|
<?php endif ?>
|
||||||
</table>
|
</tr>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
<?php if ($extensible): ?>
|
<?php if ($extensible): ?>
|
||||||
<?= $this->qlink($this->translate('Add a new user'), 'user/add', array('backend' => $backend->getName()), array(
|
<?= $this->qlink($this->translate('Add a new user'), 'user/add', array('backend' => $backend->getName()), array(
|
||||||
'icon' => 'plus',
|
'icon' => 'plus',
|
||||||
'data-base-target' => '_next',
|
'data-base-target' => '_next',
|
||||||
'class' => 'user-add'
|
'class' => 'user-add'
|
||||||
)) ?>
|
)) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue