From e936626f4b7416ff8fd2b2622ede8e24089614cb Mon Sep 17 00:00:00 2001 From: rMalie Date: Wed, 7 Mar 2012 14:15:21 +0000 Subject: [PATCH] // Fix url of admin when url rewriting is ON --- classes/Dispatcher.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/Dispatcher.php b/classes/Dispatcher.php index 6ad3142c3..24f7a3ff5 100644 --- a/classes/Dispatcher.php +++ b/classes/Dispatcher.php @@ -184,12 +184,15 @@ class DispatcherCore */ protected function __construct() { + $this->use_routes = (bool)Configuration::get('PS_REWRITING_SETTINGS'); + // Select right front controller if (defined('_PS_ADMIN_DIR_')) { $this->front_controller = self::FC_ADMIN; $this->controller_not_found = 'adminnotfound'; $this->default_controller = 'adminhome'; + $this->use_routes = false; } else if (Tools::getValue('fc') == 'module') { @@ -204,7 +207,6 @@ class DispatcherCore $this->default_controller = 'index'; } - $this->use_routes = (bool)Configuration::get('PS_REWRITING_SETTINGS'); $this->loadRoutes(); // Get request uri (HTTP_X_REWRITE_URL is used by IIS) @@ -284,7 +286,7 @@ class DispatcherCore $controllers = Dispatcher::getControllers(_PS_MODULE_DIR_.$tab->module.'/controllers/admin/'); if (!isset($controllers[$this->controller])) { - $this->controller = 'adminnotfound'; + $this->controller = $this->controller_not_found; $controller_class = 'AdminNotFoundController'; } else @@ -299,7 +301,7 @@ class DispatcherCore { $controllers = Dispatcher::getControllers(array(_PS_ADMIN_DIR_.'/tabs/', _PS_ADMIN_CONTROLLER_DIR_)); if (!isset($controllers[$this->controller])) - $this->controller = 'adminnotfound'; + $this->controller = $this->controller_not_found; $controller_class = $controllers[$this->controller]; if (file_exists(_PS_ADMIN_DIR_.'/tabs/'.$controller_class.'.php'))