2015-05-22 15:53:47 +02:00
|
|
|
<?php
|
2015-05-20 15:41:02 +02:00
|
|
|
|
|
|
|
use Icinga\Data\Updatable;
|
2015-05-22 15:53:47 +02:00
|
|
|
use Icinga\Data\Reducible;
|
2015-05-27 10:30:42 +02:00
|
|
|
use Icinga\Data\Selectable;
|
2015-05-20 15:41:02 +02:00
|
|
|
|
|
|
|
$editLink = null;
|
2015-06-25 10:13:15 +02:00
|
|
|
if ($this->hasPermission('config/authentication/users/edit') && $backend instanceof Updatable) {
|
2015-05-20 15:41:02 +02:00
|
|
|
$editLink = $this->qlink(
|
|
|
|
null,
|
|
|
|
'user/edit',
|
|
|
|
array(
|
|
|
|
'backend' => $backend->getName(),
|
|
|
|
'user' => $user->user_name
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => sprintf($this->translate('Edit user %s'), $user->user_name),
|
|
|
|
'class' => 'user-edit',
|
|
|
|
'icon' => 'edit'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
2015-10-15 14:35:30 +02:00
|
|
|
<div class="controls separated dont-print">
|
2015-06-25 11:27:28 +02:00
|
|
|
<?php if (! $this->compact): ?>
|
2015-10-15 13:45:43 +02:00
|
|
|
<?= $tabs; ?>
|
2015-06-25 11:27:28 +02:00
|
|
|
<?php endif ?>
|
2015-10-15 13:45:43 +02:00
|
|
|
<h2 class="clearfix"><?= $this->escape($user->user_name) ?><span class="pull-right"><?= $editLink ?></span></h2>
|
|
|
|
<table class="name-value-table">
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('State'); ?></th>
|
|
|
|
<td><?= $user->is_active === null ? '-' : ($user->is_active ? $this->translate('Active') : $this->translate('Inactive')); ?></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Created at'); ?></th>
|
|
|
|
<td><?= $user->created_at === null ? '-' : $this->formatDateTime($user->created_at); ?></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th><?= $this->translate('Last modified'); ?></th>
|
|
|
|
<td><?= $user->last_modified === null ? '-' : $this->formatDateTime($user->last_modified); ?></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2015-06-25 11:27:28 +02:00
|
|
|
<?php if (! $this->compact): ?>
|
2015-10-15 14:35:30 +02:00
|
|
|
<h2><?= $this->translate('Group Memberships'); ?></h2>
|
|
|
|
<div class="grid">
|
|
|
|
<?= $this->limiter; ?>
|
|
|
|
<?= $this->paginator; ?>
|
|
|
|
<?= $this->sortBox; ?>
|
|
|
|
</div>
|
2015-10-15 13:45:43 +02:00
|
|
|
<?= $this->filterEditor; ?>
|
2015-06-25 11:27:28 +02:00
|
|
|
<?php endif ?>
|
2015-06-16 02:11:16 +02:00
|
|
|
</div>
|
2015-10-15 14:35:30 +02:00
|
|
|
<div class="content">
|
2015-10-15 13:45:43 +02:00
|
|
|
<?php if ($showCreateMembershipLink): ?>
|
2015-10-01 09:39:21 +02:00
|
|
|
<?= $this->qlink(
|
2015-10-15 14:02:14 +02:00
|
|
|
$this->translate('Create New Membership') ,
|
2015-10-01 09:39:21 +02:00
|
|
|
'user/createmembership',
|
2015-10-15 13:46:34 +02:00
|
|
|
array(
|
|
|
|
'backend' => $backend->getName(),
|
|
|
|
'user' => $user->user_name
|
|
|
|
),
|
2015-10-01 09:39:21 +02:00
|
|
|
array(
|
2015-10-15 14:02:14 +02:00
|
|
|
'icon' => 'plus',
|
|
|
|
'class' => 'button-link'
|
2015-10-01 09:39:21 +02:00
|
|
|
)
|
|
|
|
) ?>
|
2015-05-22 15:53:47 +02:00
|
|
|
<?php endif ?>
|
2015-10-15 13:45:43 +02:00
|
|
|
|
|
|
|
<?php if (! $memberships->hasResult()): ?>
|
|
|
|
<p><?= $this->translate('No memberships found matching the filter'); ?></p>
|
2015-10-01 09:39:21 +02:00
|
|
|
</div>
|
2015-10-15 13:45:43 +02:00
|
|
|
<?php return; endif ?>
|
|
|
|
|
|
|
|
<table data-base-target="_next" class="action-table listing-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2015-10-15 14:35:30 +02:00
|
|
|
<th><?= $this->translate('Group'); ?></th>
|
|
|
|
<th><?= $this->translate('Cancel', 'group.membership'); ?></th>
|
2015-10-15 13:45:43 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($memberships as $membership): ?>
|
|
|
|
<tr>
|
2015-10-15 14:35:30 +02:00
|
|
|
<td>
|
2015-10-15 13:45:43 +02:00
|
|
|
<?php if ($this->hasPermission('config/authentication/groups/show') && $membership->backend instanceof Selectable): ?>
|
|
|
|
<?= $this->qlink($membership->group_name, 'group/show', array(
|
|
|
|
'backend' => $membership->backend->getName(),
|
|
|
|
'group' => $membership->group_name
|
|
|
|
), array(
|
|
|
|
'title' => sprintf($this->translate('Show detailed information for group %s'), $membership->group_name)
|
|
|
|
)); ?>
|
|
|
|
<?php else: ?>
|
|
|
|
<?= $this->escape($membership->group_name); ?>
|
|
|
|
<?php endif ?>
|
|
|
|
</td>
|
2015-10-15 14:35:30 +02:00
|
|
|
<td data-base-target="_self">
|
2015-10-15 13:45:43 +02:00
|
|
|
<?php if (isset($removeForm) && $membership->backend instanceof Reducible): ?>
|
|
|
|
<?= $removeForm->setAction($this->url('group/removemember', array(
|
|
|
|
'backend' => $membership->backend->getName(),
|
|
|
|
'group' => $membership->group_name
|
|
|
|
))); ?>
|
|
|
|
<?php else: ?>
|
|
|
|
-
|
|
|
|
<?php endif ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|