From ff935f7fc0c6b347f6c4939fa34468d9237f8198 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Tue, 26 Mar 2013 09:28:15 +0100 Subject: [PATCH] [-] CORE : fixed bug #PSCFV-8035 - 'auth' hook exception is not working --- classes/Hook.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/Hook.php b/classes/Hook.php index b3fa852c2..f88973e7c 100644 --- a/classes/Hook.php +++ b/classes/Hook.php @@ -393,7 +393,17 @@ class HookCore extends ObjectModel if ($check_exceptions) { $exceptions = $moduleInstance->getExceptions($array['id_hook']); - if (in_array(Dispatcher::getInstance()->getController(), $exceptions)) + $controller = Dispatcher::getInstance()->getController(); + + if (in_array($controller, $exceptions)) + continue; + + //retro compat of controller names + $matching_name = array( + 'authentication' => 'auth', + 'compare' => 'products-comparison', + ); + if (isset($matching_name[$controller]) && in_array($matching_name[$controller], $exceptions)) continue; if (Validate::isLoadedObject($context->employee) && !$moduleInstance->getPermission('view', $context->employee)) continue;