[+] INSTALLER : added modules install from addons

This commit is contained in:
vAugagneur
2013-03-20 11:04:48 +01:00
parent 77002bb3f5
commit b95b5861ef
6 changed files with 117 additions and 88 deletions
+6 -6
View File
@@ -156,7 +156,7 @@ class AdminModulesControllerCore extends AdminController
{
if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 86400))
{
if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, $this->addonsRequest('native')))
if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native')))
$this->status = 'refresh';
else
$this->status = 'error';
@@ -166,7 +166,7 @@ class AdminModulesControllerCore extends AdminController
if (!$this->isFresh(Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, 86400))
{
if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, $this->addonsRequest('must-have')))
if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have')))
$this->status = 'refresh';
else
$this->status = 'error';
@@ -180,7 +180,7 @@ class AdminModulesControllerCore extends AdminController
{
if (!$this->isFresh(Module::CACHE_FILE_CUSTOMER_MODULES_LIST, 60))
{
if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_CUSTOMER_MODULES_LIST, $this->addonsRequest('customer')))
if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_CUSTOMER_MODULES_LIST, Tools::addonsRequest('customer')))
$this->status = 'refresh';
else
$this->status = 'error';
@@ -198,7 +198,7 @@ class AdminModulesControllerCore extends AdminController
public function ajaxProcessLogOnAddonsWebservices()
{
$content = $this->addonsRequest('check_customer', array('username_addons' => pSQL(trim(Tools::getValue('username_addons'))), 'password_addons' => pSQL(trim(Tools::getValue('password_addons')))));
$content = Tools::addonsRequest('check_customer', array('username_addons' => pSQL(trim(Tools::getValue('username_addons'))), 'password_addons' => pSQL(trim(Tools::getValue('password_addons')))));
$xml = @simplexml_load_string($content, null, LIBXML_NOCDATA);
if (!$xml)
die('KO');
@@ -629,10 +629,10 @@ class AdminModulesControllerCore extends AdminController
if ($name == $modaddons->name && isset($modaddons->id) && ($this->logged_on_addons || $f['loggedOnAddons'] == 0))
{
if ($f['loggedOnAddons'] == 0)
if (file_put_contents('../modules/'.$modaddons->name.'.zip', $this->addonsRequest('module', array('id_module' => pSQL($modaddons->id)))))
if (file_put_contents('../modules/'.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id)))))
$this->extractArchive('../modules/'.$modaddons->name.'.zip', false);
if ($f['loggedOnAddons'] == 1 && $this->logged_on_addons)
if (file_put_contents('../modules/'.$modaddons->name.'.zip', $this->addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons))))))
if (file_put_contents('../modules/'.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons))))))
$this->extractArchive('../modules/'.$modaddons->name.'.zip', false);
}
}