-
-
Save mam08ixo/3937df764da7a6816a1d to your computer and use it in GitHub Desktop.
SUPEE-6788 variable + block setup script. 1.) Create a new module or extend a current one. 2.) Create a new install or setup script with the variables and blocks which are not whitelisted yet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @category Namespace | |
* @package Namespace_Module | |
* @author Anna Völkl | |
* @author Christoph Aßmann | |
* @author Fabian Schmengler | |
*/ | |
/** @var Mage_Core_Model_Resource_Setup $installer */ | |
$installer = $this; | |
// Make sure the upgrade is not performed on legacy installations with tables missing | |
$adminVersion = Mage::getConfig()->getModuleConfig('Mage_Admin')->version; | |
if (version_compare($adminVersion, '1.6.1.1', '>')) { | |
$connection = $installer->getConnection(); | |
//--------------------------------------------------- | |
// Add variables | |
//--------------------------------------------------- | |
$table = $installer->getTable('admin/permission_variable'); | |
$variableNames = array( | |
'design/email/logo_alt', | |
'design/email/logo_width', | |
'design/email/logo_height', | |
); | |
foreach ($variableNames as $variableName) { | |
$connection->insertIgnore($table, array( | |
'variable_name' => $variableName, | |
'is_allowed' => 1, | |
)); | |
} | |
//--------------------------------------------------- | |
// Add blocks | |
//--------------------------------------------------- | |
$table = $installer->getTable('admin/permission_block'); | |
$blockNames = array( | |
'cms/block', | |
'catalog/product_list', | |
'germany/impressum', | |
'page/html', | |
'magesetup/imprint_field', | |
'magesetup/imprint_content' | |
); | |
foreach ($blockNames as $blockName) { | |
$connection->insertIgnore($table, array( | |
'block_name' => $blockName, | |
'is_allowed' => 1, | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment