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-05-27 10:27:48 +02:00
|
|
|
if ($this->hasPermission('config/application/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'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<div class="controls">
|
2015-05-22 15:53:47 +02:00
|
|
|
<?php if (! $this->compact): ?>
|
2015-05-22 16:13:20 +02:00
|
|
|
<?= $tabs; ?>
|
2015-05-22 15:53:47 +02:00
|
|
|
<?php endif ?>
|
2015-05-20 15:41:02 +02:00
|
|
|
<div class="user-header">
|
|
|
|
<p class="user-name"><strong><?= $this->escape($user->user_name); ?></strong></p> <?= $editLink; ?>
|
|
|
|
<p class="user-state"><strong><?= $this->translate('State'); ?>:</strong> <?= $user->is_active ? $this->translate('Active') : $this->translate('Inactive'); ?></p>
|
|
|
|
<p class="user-created"><strong><?= $this->translate('Created at'); ?>:</strong> <?= $user->created_at === null ? '-' : $this->formatDateTime($user->created_at); ?></p>
|
|
|
|
<p class="user-modified"><strong><?= $this->translate('Last modified'); ?>:</strong> <?= $user->last_modified === null ? '-' : $this->formatDateTime($user->last_modified); ?></p>
|
|
|
|
</div>
|
2015-05-22 15:53:47 +02:00
|
|
|
<?php if (! $this->compact): ?>
|
|
|
|
<?= $this->sortBox; ?>
|
|
|
|
<?php endif ?>
|
|
|
|
<?= $this->limiter; ?>
|
|
|
|
<?= $this->paginator; ?>
|
|
|
|
<?php if (! $this->compact): ?>
|
|
|
|
<?= $this->filterEditor; ?>
|
|
|
|
<?php endif ?>
|
2015-05-20 15:41:02 +02:00
|
|
|
</div>
|
2015-05-22 15:53:47 +02:00
|
|
|
<div class="content memberships" data-base-target="_next">
|
|
|
|
<?php if (count($memberships) > 0): ?>
|
|
|
|
<table data-base-target="_next" class="action membership-list">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="membership-group"><?= $this->translate('Group'); ?></th>
|
|
|
|
<th class="membership-cancel"><?= $this->translate('Cancel', 'group.membership'); ?></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($memberships as $membership): ?>
|
|
|
|
<tr>
|
2015-05-27 10:30:42 +02:00
|
|
|
<td class="membership-group">
|
|
|
|
<?php if ($this->hasPermission('config/application/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-05-22 15:53:47 +02:00
|
|
|
<td class="membership-cancel" data-base-target="_self">
|
|
|
|
<?php if ($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>
|
|
|
|
<?php else: ?>
|
|
|
|
<p><?= $this->translate('No memberships found matching the filter'); ?></p>
|
|
|
|
<?php endif ?>
|
2015-05-26 17:03:10 +02:00
|
|
|
<?php if ($showCreateMembershipLink): ?>
|
2015-05-22 15:53:47 +02:00
|
|
|
<?= $this->qlink($this->translate('Create new membership'), 'user/createmembership', array(
|
2015-05-26 17:03:10 +02:00
|
|
|
'backend' => $backend->getName(),
|
|
|
|
'user' => $user->user_name
|
2015-05-22 15:53:47 +02:00
|
|
|
), array(
|
2015-05-26 17:03:10 +02:00
|
|
|
'icon' => 'plus',
|
|
|
|
'data-base-target' => '_next',
|
|
|
|
'class' => 'membership-create'
|
2015-05-22 15:53:47 +02:00
|
|
|
)); ?>
|
2015-05-26 17:03:10 +02:00
|
|
|
<?php endif ?>
|
2015-05-20 15:41:02 +02:00
|
|
|
</div>
|