[-] FO: Fix module restriction with guest and visitors groups #PSCFV-4004

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17298 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-09-12 08:50:24 +00:00
parent ed881352d0
commit 44d49911a9
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -257,6 +257,10 @@ class HookCore extends ObjectModel
$shop_list = Shop::getContextListShopID();
if (isset($context->customer) && $context->customer->isLogged())
$groups = $context->customer->getGroups();
elseif (isset($context->customer) && $context->customer->isLogged(true))
$groups = array((int)Configuration::get('PS_GUEST_GROUP'));
else
$groups = array((int)Configuration::get('PS_UNIDENTIFIED_GROUP'));
}
// SQL Request
@@ -274,7 +278,7 @@ class HookCore extends ObjectModel
if (Validate::isLoadedObject($context->shop))
$sql->where('hm.id_shop = '.(int)$context->shop->id);
if (isset($context->customer) && $context->customer->isLogged())
if ($frontend)
{
$sql->leftJoin('module_group', 'mg', 'mg.`id_module` = m.`id_module`');
$sql->where('mg.`id_group` IN ('.implode(', ', $groups).')');