From 55e9fc7a528d78a2f097d306f993bfc78c1013ee Mon Sep 17 00:00:00 2001 From: fSerny Date: Thu, 22 Dec 2011 18:11:37 +0000 Subject: [PATCH] [-] BO : You can now download native modules even when you logged on Addons git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11655 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminModulesController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 3a16f9708..6da867dd4 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -505,8 +505,14 @@ class AdminModulesControllerCore extends AdminController $xml = @simplexml_load_string($content, NULL, LIBXML_NOCDATA); foreach ($xml->module as $modaddons) if ($name == $modaddons->name && isset($modaddons->id) && ($this->logged_on_addons || $f['loggedOnAddons'] == 0)) - if (@copy($this->addons_url.'module/'.pSQL($modaddons->id).'/'.pSQL(trim($this->context->cookie->username_addons)).'/'.pSQL(trim($this->context->cookie->password_addons)), '../modules/'.$modaddons->name.'.zip')) - $this->extractArchive('../modules/'.$modaddons->name.'.zip', false); + { + if ($f['loggedOnAddons'] == 0) + if (@copy($this->addons_url.'module/'.pSQL($modaddons->id).'/', '../modules/'.$modaddons->name.'.zip')) + $this->extractArchive('../modules/'.$modaddons->name.'.zip', false); + if ($f['loggedOnAddons'] == 1 && $this->logged_on_addons) + if (@copy($this->addons_url.'module/'.pSQL($modaddons->id).'/'.pSQL(trim($this->context->cookie->username_addons)).'/'.pSQL(trim($this->context->cookie->password_addons)), '../modules/'.$modaddons->name.'.zip')) + $this->extractArchive('../modules/'.$modaddons->name.'.zip', false); + } } }