From 3fdfcd5e63ac0779c7fcf6bd1108f43d274e56fb Mon Sep 17 00:00:00 2001 From: fSerny Date: Tue, 22 Nov 2011 09:54:14 +0000 Subject: [PATCH] // Addons connection --- controllers/admin/AdminModulesController.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index eb89c0861..114f4ea3f 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -486,6 +486,26 @@ class AdminModulesControllerCore extends AdminController if ($modules) foreach ($modules AS $name) { + // If Addons Module + if ($this->logged_on_addons && !is_dir('../modules/'.$name.'/')) + { + $file = _PS_ROOT_DIR_.'/config/default_customer_modules_list.xml'; + if (file_exists($file)) + { + $content = Tools::file_get_contents($file); + $xml = @simplexml_load_string($content, NULL, LIBXML_NOCDATA); + foreach ($xml->module as $modaddons) + { + if ($name == $modaddons->name && isset($modaddons->id)) + { + @copy($this->addons_url.'module/'.pSQL($modaddons->id).'/'.pSQL(trim($this->context->cookie->username_addons)).'/'.pSQL(trim($this->context->cookie->password_addons)), '../modules/'.$this->name.'.zip'); + $this->extractArchive('../modules/'.$this->name.'.zip'); + } + } + } + + } + if (!($module = Module::getInstanceByName(urldecode($name)))) $this->_errors[] = $this->l('module not found'); elseif ($key == 'install' AND $this->tabAccess['add'] !== '1')