parent
00880710ed
commit
4d2e6d2d87
|
@ -4,6 +4,7 @@
|
|||
namespace Icinga\Application\Modules;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Zend_Controller_Router_Route;
|
||||
use Zend_Controller_Router_Route_Abstract;
|
||||
use Zend_Controller_Router_Route_Regex;
|
||||
|
@ -1282,19 +1283,22 @@ class Module
|
|||
*/
|
||||
protected function provideHook($name, $implementation = null, $key = null)
|
||||
{
|
||||
if ($implementation === null) {
|
||||
$implementation = $name;
|
||||
if (Auth::getInstance()->hasPermission('module/' . $this->name)) {
|
||||
if ($implementation === null) {
|
||||
$implementation = $name;
|
||||
}
|
||||
|
||||
if (strpos($implementation, '\\') === false) {
|
||||
$class = $this->getNamespace()
|
||||
. '\\ProvidedHook\\'
|
||||
. $this->slashesToNamespace($implementation);
|
||||
} else {
|
||||
$class = $implementation;
|
||||
}
|
||||
|
||||
Hook::register($name, $class, $class);
|
||||
}
|
||||
|
||||
if (strpos($implementation, '\\') === false) {
|
||||
$class = $this->getNamespace()
|
||||
. '\\ProvidedHook\\'
|
||||
. $this->slashesToNamespace($implementation);
|
||||
} else {
|
||||
$class = $implementation;
|
||||
}
|
||||
|
||||
Hook::register($name, $class, $class);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue