Fix dispatching namespaced module controllers

refs #5786
This commit is contained in:
Eric Lippmann 2015-08-18 11:11:28 +02:00
parent fae2e0979a
commit e31dce97a9
1 changed files with 2 additions and 2 deletions

View File

@ -44,10 +44,10 @@ class Dispatcher extends Zend_Controller_Dispatcher_Standard
return;
}
$controllerName = ucfirst($controllerName) . 'Controller';
if ($this->_defaultModule === $this->_curModule) {
if ($this->_defaultModule === $moduleName = $request->getModuleName()) {
$controllerClass = 'Icinga\\' . self::CONTROLLER_NAMESPACE . '\\' . $controllerName;
} else {
$controllerClass = 'Icinga\\Module\\' . $this->_curModule . '\\' . self::CONTROLLER_NAMESPACE . '\\'
$controllerClass = 'Icinga\\Module\\' . ucfirst($moduleName) . '\\' . self::CONTROLLER_NAMESPACE . '\\'
. $controllerName;
}
if (! class_exists($controllerClass)) {