// AdminControllers fixes

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10821 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-11-30 18:16:13 +00:00
parent 29c75d7798
commit bca384dc71
4 changed files with 17 additions and 7 deletions
+12 -3
View File
@@ -85,18 +85,27 @@ class AdminPaymentControllerCore extends AdminController
}
public function postProcess()
{
if ($this->action)
$this->saveRestrictions($this->action);
}
public function initProcess()
{
if ($this->tabAccess['edit'] === '1')
{
if (Tools::isSubmit('submitModulecountry'))
$this->saveRestrictions('country');
$this->action = 'country';
else if (Tools::isSubmit('submitModulecurrency'))
$this->saveRestrictions('currency');
$this->action ='currency';
else if (Tools::isSubmit('submitModulegroup'))
$this->saveRestrictions('group');
$this->action ='group';
}
else
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
}
private function saveRestrictions($type)
{
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'module_'.bqSQL($type).'` WHERE id_shop = '.Context::getContext()->shop->getID(true));