From d7085cce80644ff110faf9a8a0203be883b0b3c8 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 --- 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); + } } }