From 01daa38eaec94ac2a74292a7a62f699e9aaea569 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 17 Jan 2017 14:56:13 +0100 Subject: [PATCH] Fix module permissions for hooks refs #2686 --- library/Icinga/Application/Hook.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Application/Hook.php b/library/Icinga/Application/Hook.php index 3a158a57c..99a350a23 100644 --- a/library/Icinga/Application/Hook.php +++ b/library/Icinga/Application/Hook.php @@ -263,7 +263,7 @@ class Hook } foreach (self::$hooks[$name] as $key => $hook) { - if (self::hasPermission($key)) { + if (self::hasPermission($hook)) { if (self::createInstance($name, $key) === null) { return array(); } @@ -286,7 +286,7 @@ class Hook if (self::has($name)) { foreach (self::$hooks[$name] as $key => $hook) { - if (self::hasPermission($key)) { + if (self::hasPermission($hook)) { return self::createInstance($name, $key); } } @@ -309,6 +309,8 @@ class Hook self::$hooks[$name] = array(); } + $class = ltrim($class, ClassLoader::NAMESPACE_SEPARATOR); + self::$hooks[$name][$key] = $class; } }