mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
configuration.php: Properly populate sidebar and dashboard..
..if monitoring is installed but not accessible. fixes #717
This commit is contained in:
parent
3c5785db37
commit
0710ebab31
1 changed files with 6 additions and 6 deletions
|
|
@ -14,6 +14,9 @@ namespace Icinga\Module\Icingadb {
|
|||
|
||||
/** @var \Icinga\Application\Modules\Module $this */
|
||||
|
||||
$auth = Auth::getInstance();
|
||||
$authenticated = Icinga::app()->isWeb() && $auth->isAuthenticated();
|
||||
|
||||
$this->provideSetupWizard('Icinga\Module\Icingadb\Setup\IcingaDbWizard');
|
||||
|
||||
$this->providePermission(
|
||||
|
|
@ -132,7 +135,7 @@ namespace Icinga\Module\Icingadb {
|
|||
$this->translate('Obfuscate custom variable values of Icinga objects that are part of the list')
|
||||
);
|
||||
|
||||
if (! $this::exists('monitoring')) {
|
||||
if (! $this::exists('monitoring') || ($authenticated && ! $auth->getUser()->can('module/monitoring'))) {
|
||||
/*
|
||||
* Available navigation items
|
||||
*/
|
||||
|
|
@ -337,9 +340,8 @@ namespace Icinga\Module\Icingadb {
|
|||
'url' => 'icingadb/services',
|
||||
'icon' => 'cog'
|
||||
]);
|
||||
$auth = Auth::getInstance();
|
||||
$routeDenylist = [];
|
||||
if ($auth->isAuthenticated() && ! $auth->getUser()->isUnrestricted()) {
|
||||
if ($authenticated && ! $auth->getUser()->isUnrestricted()) {
|
||||
// The empty array is for PHP pre 7.4, older versions require at least a single param for array_merge
|
||||
$routeDenylist = array_flip(array_merge([], ...array_map(function ($restriction) {
|
||||
return StringHelper::trimSplit($restriction);
|
||||
|
|
@ -466,10 +468,8 @@ namespace Icinga\Module\Icingadb {
|
|||
'priority' => 40
|
||||
]);
|
||||
|
||||
|
||||
$auth = Auth::getInstance();
|
||||
$routeDenylist = [];
|
||||
if ($auth->isAuthenticated() && ! $auth->getUser()->isUnrestricted()) {
|
||||
if ($authenticated && ! $auth->getUser()->isUnrestricted()) {
|
||||
// The empty array is for PHP pre 7.4, older versions require at least a single param for array_merge
|
||||
$routeDenylist = array_flip(array_merge([], ...array_map(function ($restriction) {
|
||||
return StringHelper::trimSplit($restriction);
|
||||
|
|
|
|||
Loading…
Reference in a new issue