2015-05-22 09:53:47 -04:00
|
|
|
<?php
|
2015-05-20 09:41:02 -04:00
|
|
|
|
|
|
|
|
use Icinga\Data\Updatable;
|
2015-05-22 09:53:47 -04:00
|
|
|
use Icinga\Data\Reducible;
|
2015-05-27 04:30:42 -04:00
|
|
|
use Icinga\Data\Selectable;
|
2015-05-20 09:41:02 -04:00
|
|
|
|
|
|
|
|
?>
|
2015-12-10 06:05:48 -05:00
|
|
|
<div class="controls separated">
|
2015-06-25 05:27:28 -04:00
|
|
|
<?php if (! $this->compact): ?>
|
2015-10-15 07:45:43 -04:00
|
|
|
<?= $tabs; ?>
|
2015-06-25 05:27:28 -04:00
|
|
|
<?php endif ?>
|
2016-02-18 07:07:36 -05:00
|
|
|
<h2><?= $this->escape($user->user_name) ?></h2>
|
|
|
|
|
<?php
|
2021-02-18 02:52:57 -05:00
|
|
|
if ($this->hasPermission('config/access-control/users') && $backend instanceof Updatable) {
|
2016-02-18 07:07:36 -05:00
|
|
|
echo $this->qlink(
|
|
|
|
|
$this->translate('Edit User'),
|
|
|
|
|
'user/edit',
|
|
|
|
|
array(
|
|
|
|
|
'backend' => $backend->getName(),
|
|
|
|
|
'user' => $user->user_name
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'class' => 'button-link',
|
2016-02-22 05:35:07 -05:00
|
|
|
'icon' => 'edit',
|
|
|
|
|
'title' => sprintf($this->translate('Edit user %s'), $user->user_name)
|
2016-02-18 07:07:36 -05:00
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
?>
|
2015-10-15 07:45:43 -04:00
|
|
|
<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>
|
2019-09-25 04:41:58 -04:00
|
|
|
<tr>
|
|
|
|
|
<th><?= $this->translate('Role Memberships'); ?></th>
|
|
|
|
|
<td>
|
2020-04-09 09:04:10 -04:00
|
|
|
<?php $roles = $userObj->getRoles(); ?>
|
|
|
|
|
<?php if (! empty($roles)): ?>
|
2019-09-25 09:04:54 -04:00
|
|
|
<ul class="role-memberships">
|
2020-04-09 09:04:10 -04:00
|
|
|
<?php foreach($roles as $role): ?>
|
2019-09-25 09:04:54 -04:00
|
|
|
<li>
|
|
|
|
|
<?php if ($this->allowedToEditRoles): ?>
|
|
|
|
|
<?= $this->qlink(
|
|
|
|
|
$role->getName(),
|
|
|
|
|
'role/edit',
|
|
|
|
|
['role' => $role->getName()],
|
|
|
|
|
['title' => sprintf($this->translate('Edit role %s'), $role->getName())]
|
2020-04-09 09:04:10 -04:00
|
|
|
);
|
|
|
|
|
$role === end($roles) ? print '' : print ', '; ?>
|
2019-09-25 09:04:54 -04:00
|
|
|
<?php else: ?>
|
|
|
|
|
<?= $role->getName() ?>
|
|
|
|
|
<?php endif ?>
|
|
|
|
|
</li>
|
|
|
|
|
<?php endforeach ?>
|
|
|
|
|
</ul>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<p><?= $this->translate('No memberships found'); ?></p>
|
|
|
|
|
<?php endif ?>
|
2019-09-25 04:41:58 -04:00
|
|
|
</td>
|
|
|
|
|
</tr>
|
2015-10-15 07:45:43 -04:00
|
|
|
</table>
|
2015-06-25 05:27:28 -04:00
|
|
|
<?php if (! $this->compact): ?>
|
2015-10-15 08:35:30 -04:00
|
|
|
<h2><?= $this->translate('Group Memberships'); ?></h2>
|
2019-07-26 08:16:49 -04:00
|
|
|
<div class="sort-controls-container">
|
2015-10-15 08:35:30 -04:00
|
|
|
<?= $this->limiter; ?>
|
|
|
|
|
<?= $this->paginator; ?>
|
|
|
|
|
<?= $this->sortBox; ?>
|
|
|
|
|
</div>
|
2015-10-15 07:45:43 -04:00
|
|
|
<?= $this->filterEditor; ?>
|
2015-06-25 05:27:28 -04:00
|
|
|
<?php endif ?>
|
2015-06-15 20:11:16 -04:00
|
|
|
</div>
|
2015-10-15 08:35:30 -04:00
|
|
|
<div class="content">
|
2015-10-15 07:45:43 -04:00
|
|
|
<?php if ($showCreateMembershipLink): ?>
|
2015-10-01 03:39:21 -04:00
|
|
|
<?= $this->qlink(
|
2015-10-15 09:46:04 -04:00
|
|
|
$this->translate('Create New Membership'),
|
2015-10-01 03:39:21 -04:00
|
|
|
'user/createmembership',
|
2015-10-15 07:46:34 -04:00
|
|
|
array(
|
|
|
|
|
'backend' => $backend->getName(),
|
|
|
|
|
'user' => $user->user_name
|
|
|
|
|
),
|
2015-10-01 03:39:21 -04:00
|
|
|
array(
|
2015-10-15 08:02:14 -04:00
|
|
|
'icon' => 'plus',
|
|
|
|
|
'class' => 'button-link'
|
2015-10-01 03:39:21 -04:00
|
|
|
)
|
|
|
|
|
) ?>
|
2015-05-22 09:53:47 -04:00
|
|
|
<?php endif ?>
|
2015-10-15 07:45:43 -04:00
|
|
|
|
|
|
|
|
<?php if (! $memberships->hasResult()): ?>
|
|
|
|
|
<p><?= $this->translate('No memberships found matching the filter'); ?></p>
|
2015-10-01 03:39:21 -04:00
|
|
|
</div>
|
2015-10-15 07:45:43 -04:00
|
|
|
<?php return; endif ?>
|
|
|
|
|
|
2015-11-13 09:21:07 -05:00
|
|
|
<table data-base-target="_next" class="table-row-selectable common-table">
|
2015-10-15 07:45:43 -04:00
|
|
|
<thead>
|
|
|
|
|
<tr>
|
2015-10-15 08:35:30 -04:00
|
|
|
<th><?= $this->translate('Group'); ?></th>
|
|
|
|
|
<th><?= $this->translate('Cancel', 'group.membership'); ?></th>
|
2015-10-15 07:45:43 -04:00
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php foreach ($memberships as $membership): ?>
|
|
|
|
|
<tr>
|
2015-10-15 08:35:30 -04:00
|
|
|
<td>
|
2021-02-18 02:52:57 -05:00
|
|
|
<?php if ($this->hasPermission('config/access-control/groups') && $membership->backend instanceof Selectable): ?>
|
2015-10-15 07:45:43 -04:00
|
|
|
<?= $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 09:46:04 -04:00
|
|
|
<td class="icon-col" data-base-target="_self">
|
2015-10-15 07:45:43 -04: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>
|
2015-10-01 03:39:21 -04:00
|
|
|
</div>
|