mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 09:14:08 +02:00
Allow to get permissions and restrictions from unloaded modules
refs #9644
This commit is contained in:
parent
444fdadf13
commit
519d025de5
@ -113,6 +113,13 @@ class Module
|
|||||||
*/
|
*/
|
||||||
private $triedToLaunchConfigScript = false;
|
private $triedToLaunchConfigScript = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the module's namespace has been registered on our autoloader
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $registeredAutoloader = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this module has been registered
|
* Whether this module has been registered
|
||||||
*
|
*
|
||||||
@ -855,6 +862,10 @@ class Module
|
|||||||
*/
|
*/
|
||||||
protected function registerAutoloader()
|
protected function registerAutoloader()
|
||||||
{
|
{
|
||||||
|
if ($this->registeredAutoloader) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
$moduleName = ucfirst($this->getName());
|
$moduleName = ucfirst($this->getName());
|
||||||
|
|
||||||
$moduleLibraryDir = $this->getLibDir(). '/'. $moduleName;
|
$moduleLibraryDir = $this->getLibDir(). '/'. $moduleName;
|
||||||
@ -867,6 +878,8 @@ class Module
|
|||||||
$this->app->getLoader()->registerNamespace('Icinga\\Module\\' . $moduleName. '\\Forms', $moduleFormDir);
|
$this->app->getLoader()->registerNamespace('Icinga\\Module\\' . $moduleName. '\\Forms', $moduleFormDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->registeredAutoloader = true;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1011,7 +1024,7 @@ class Module
|
|||||||
*/
|
*/
|
||||||
protected function launchConfigScript()
|
protected function launchConfigScript()
|
||||||
{
|
{
|
||||||
if ($this->triedToLaunchConfigScript || !$this->registered) {
|
if ($this->triedToLaunchConfigScript) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->triedToLaunchConfigScript = true;
|
$this->triedToLaunchConfigScript = true;
|
||||||
@ -1019,6 +1032,7 @@ class Module
|
|||||||
|| ! is_readable($this->configScript)) {
|
|| ! is_readable($this->configScript)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$this->registerAutoloader();
|
||||||
include($this->configScript);
|
include($this->configScript);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user