-
-
Save tivuno/ba81febd7ca94b3bce1033b80c86c712 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Cornelius - Core PrestaShop module | |
* @author tivuno.com <hi@tivuno.com> | |
* @copyright 2018 - 2024 © tivuno.com | |
* @license https://tivuno.com/blog/bp/business-news/2-basic-license | |
*/ | |
if (!defined('_PS_ADMIN_DIR_')) { | |
define('_PS_ADMIN_DIR_', __DIR__); | |
} | |
include _PS_ADMIN_DIR_ . '/../config/config.inc.php'; | |
// echo md5(_COOKIE_KEY_ . Configuration::get('PS_SHOP_NAME')); | |
if (isset($_GET['secure_key']) && isset($_GET['module'])) { | |
$secureKey = md5(_COOKIE_KEY_ . Configuration::get('PS_SHOP_NAME')); | |
if ($secureKey === $_GET['secure_key']) { | |
$module = Module::getInstanceByName($_GET['module']); | |
if (Validate::isLoadedObject($module) && Module::isEnabled($_GET['module'])) { | |
require_once _PS_MODULE_DIR_ . 'tvcore/models/TvcoreFile.php'; | |
$module_dir = _PS_MODULE_DIR_ . $_GET['module']; | |
$directories = TvcoreFile::getSubDirectories($module_dir); | |
foreach ($directories as $dir) { | |
TvcoreFile::copyFile($module_dir, $dir, 'index.php'); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment