Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions application/controllers/RoleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Icinga\Web\Controller\AuthBackendController;
use Icinga\Web\View\PrivilegeAudit;
use Icinga\Web\Widget\SingleValueSearchControl;
use Icinga\Web\Widget\Tabextension\OutputFormat;
use ipl\Html\Html;
use ipl\Html\HtmlString;
use ipl\Web\Url;
Expand Down Expand Up @@ -143,6 +144,7 @@ public function removeAction()

public function auditAction()
{
$this->getTabs()->extend(new OutputFormat(["csv", "json"]));
$this->assertPermission('config/access-control/roles');
$this->createListTabs()->activate('role/audit');
$this->view->title = t('Audit');
Expand Down Expand Up @@ -192,13 +194,13 @@ public function auditAction()
}

if ($type === 'user') {
$header = Html::tag('h2', sprintf(t('Privilege Audit for User "%s"'), $name));
$title = sprintf(t('Privilege Audit for User "%s"'), $name);

$user = new User($name);
$user->setAdditional('backend_name', $backend);
Auth::getInstance()->setupUser($user);
} else {
$header = Html::tag('h2', sprintf(t('Privilege Audit for Group "%s"'), $name));
$title = sprintf(t('Privilege Audit for Group "%s"'), $name);

$user = new User((string) time());
$user->setGroups([$name]);
Expand Down Expand Up @@ -244,7 +246,8 @@ public function auditAction()
]
));

$this->addControl($header);
Comment thread
moreamazingnick marked this conversation as resolved.
$this->setTitle($title);
$this->addControl(Html::tag('h2', $title));
$this->addContent(
(new PrivilegeAudit($chosenRole !== null ? [$chosenRole] : $assignedRoles))
->addAttributes(['id' => 'role-audit'])
Expand Down