Last active
April 26, 2016 09:31
-
-
Save mklooss/247f4f619799af331fd3 to your computer and use it in GitHub Desktop.
insert imprint data as allowed permissions for SUPEE-6788
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
Find Block in Contents | |
SELECT * FROM `cms_block` WHERE `content` LIKE '%{{block%'; | |
SELECT * FROM `cms_page` WHERE `content` LIKE '%{{block%'; | |
SELECT * FROM `core_email_template` WHERE `template_text` LIKE '%{{block%'; | |
thanks @http://www.webguys.de/magento/supee-6788-und-block-direktiven-neues-berechtigungskonzept/ | |
Find Config Varibales in Contents | |
SELECT * FROM `cms_block` WHERE `content` LIKE '%{{config%'; | |
SELECT * FROM `cms_page` WHERE `content` LIKE '%{{config%'; | |
SELECT * FROM `core_email_template` WHERE `template_text` LIKE '%{{config%'; |
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 | |
$data = 'core/template | |
catalog/product_new | |
catalog/product_list | |
magesetup/imprint_field | |
magesetup/imprint_content | |
germansetup/imprint_field | |
germansetup/imprint_content | |
cms/block'; | |
$data = str_replace("\r", '', $data); | |
$data = array_filter((array) explode("\n", $data)); | |
require_once 'app/Mage.php'; | |
Mage::app('admin'); | |
$resource = Mage::getSingleton('core/resource'); | |
$writeConnection = $resource->getConnection('core_write'); | |
$data = array_unique($data); | |
foreach($data as $_row) | |
{ | |
$_data = array( | |
'is_allowed' => 1, | |
'block_name' => $_row | |
); | |
$writeConnection->insertOnDuplicate($resource->getTableName('permission_block'), $_data); | |
echo 'insert "'.$_row.'"'."\n"; | |
} |
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 | |
$data = 'general/imprint/shop_name | |
general/imprint/company_first | |
general/imprint/company_second | |
general/imprint/street | |
general/imprint/zip | |
general/imprint/city | |
general/imprint/country | |
general/imprint/telephone | |
general/imprint/telephone_additional | |
general/imprint/fax | |
general/imprint/email | |
general/imprint/web | |
general/imprint/tax_number | |
general/imprint/vat_id | |
general/imprint/court | |
general/imprint/financial_office | |
general/imprint/ceo | |
general/imprint/owner | |
general/imprint/content_responsable_name | |
general/imprint/content_responsable_address | |
general/imprint/content_responsable_press_law | |
general/imprint/register_number | |
general/imprint/business_rules | |
general/imprint/authority | |
general/imprint/shareholdings | |
general/imprint/editorial_concept | |
general/imprint/bank_account_owner | |
general/imprint/bank_account | |
general/imprint/bank_code_number | |
general/imprint/bank_name | |
general/imprint/swift | |
general/imprint/iban | |
general/imprint/clearing | |
general/store_information/name | |
general/store_information/phone | |
general/store_information/merchant_country | |
general/store_information/merchant_vat_number | |
general/store_information/address'; | |
$data = str_replace("\r", '', $data); | |
$data = array_filter((array) explode("\n", $data)); | |
require_once 'app/Mage.php'; | |
Mage::app('admin'); | |
$resource = Mage::getSingleton('core/resource'); | |
$writeConnection = $resource->getConnection('core_write'); | |
$query = $writeConnection->select() | |
->from($resource->getTableName('core_config_data'), 'path') | |
->where('path LIKE "general/imprint/%"'); | |
foreach($writeConnection->fetchCol($query) as $_row) | |
{ | |
$data[] = $_row; | |
} | |
$data = array_unique($data); | |
foreach($data as $_row) | |
{ | |
$_data = array( | |
'is_allowed' => 1, | |
'variable_name' => $_row | |
); | |
$writeConnection->insertOnDuplicate($resource->getTableName('permission_variable'), $_data); | |
echo 'insert "'.$_row.'"'."\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment