mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
parent
705bb665a5
commit
5c6d5f51c4
@ -19,15 +19,6 @@ use Icinga\Web\Widget;
|
|||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Initialize this controller
|
|
||||||
*/
|
|
||||||
public function init()
|
|
||||||
{
|
|
||||||
parent::init();
|
|
||||||
$this->createTabs();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirect to this controller's list action
|
* Redirect to this controller's list action
|
||||||
*/
|
*/
|
||||||
@ -85,7 +76,7 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->view->backend = $backend;
|
$this->view->backend = $backend;
|
||||||
$this->getTabs()->activate('user/list');
|
$this->createListTabs()->activate('user/list');
|
||||||
|
|
||||||
$this->setupLimitControl();
|
$this->setupLimitControl();
|
||||||
$this->setupSortControl(
|
$this->setupSortControl(
|
||||||
@ -139,6 +130,7 @@ class UserController extends Controller
|
|||||||
$this->view->user = $user;
|
$this->view->user = $user;
|
||||||
$this->view->backend = $backend;
|
$this->view->backend = $backend;
|
||||||
$this->view->memberships = $memberships;
|
$this->view->memberships = $memberships;
|
||||||
|
$this->createShowTabs($backend->getName(), $userName)->activate('user/show');
|
||||||
|
|
||||||
$removeForm = new Form();
|
$removeForm = new Form();
|
||||||
$removeForm->setUidDisabled();
|
$removeForm->setUidDisabled();
|
||||||
@ -306,9 +298,9 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the tabs
|
* Create the tabs to list users and groups
|
||||||
*/
|
*/
|
||||||
protected function createTabs()
|
protected function createListTabs()
|
||||||
{
|
{
|
||||||
$tabs = $this->getTabs();
|
$tabs = $this->getTabs();
|
||||||
$tabs->add(
|
$tabs->add(
|
||||||
@ -316,7 +308,7 @@ class UserController extends Controller
|
|||||||
array(
|
array(
|
||||||
'title' => $this->translate('List users of authentication backends'),
|
'title' => $this->translate('List users of authentication backends'),
|
||||||
'label' => $this->translate('Users'),
|
'label' => $this->translate('Users'),
|
||||||
'icon' => 'users',
|
'icon' => 'user',
|
||||||
'url' => 'user/list'
|
'url' => 'user/list'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -325,9 +317,33 @@ class UserController extends Controller
|
|||||||
array(
|
array(
|
||||||
'title' => $this->translate('List groups of user group backends'),
|
'title' => $this->translate('List groups of user group backends'),
|
||||||
'label' => $this->translate('Groups'),
|
'label' => $this->translate('Groups'),
|
||||||
'icon' => 'cubes',
|
'icon' => 'users',
|
||||||
'url' => 'group/list'
|
'url' => 'group/list'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return $tabs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the tabs to display when showing a user
|
||||||
|
*
|
||||||
|
* @param string $backendName
|
||||||
|
* @param string $userName
|
||||||
|
*/
|
||||||
|
protected function createShowTabs($backendName, $userName)
|
||||||
|
{
|
||||||
|
$tabs = $this->getTabs();
|
||||||
|
$tabs->add(
|
||||||
|
'user/show',
|
||||||
|
array(
|
||||||
|
'title' => sprintf($this->translate('Show user %s'), $userName),
|
||||||
|
'label' => $this->translate('User'),
|
||||||
|
'icon' => 'user',
|
||||||
|
'url' => Url::fromPath('user/show', array('backend' => $backendName, 'user' => $userName))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return $tabs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ if ($backend instanceof Updatable) {
|
|||||||
?>
|
?>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<?php if (! $this->compact): ?>
|
<?php if (! $this->compact): ?>
|
||||||
<?= $tabs->showOnlyCloseButton(); ?>
|
<?= $tabs; ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<div class="user-header">
|
<div class="user-header">
|
||||||
<p class="user-name"><strong><?= $this->escape($user->user_name); ?></strong></p> <?= $editLink; ?>
|
<p class="user-name"><strong><?= $this->escape($user->user_name); ?></strong></p> <?= $editLink; ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user