Beispiel #1
0
}
// check tool permission
if (!CAT_Users::get_permission($get_tool, 'module')) {
    header("Location: index.php");
    exit(0);
}
global $parser;
$parser->setGlobals('CAT_ADMIN_URL', CAT_ADMIN_URL);
// ==============================
// ! Check if tool is installed
// ==============================
if (!CAT_Helper_Addons::isModuleInstalled($get_tool)) {
    header("Location: index.php");
    exit(0);
}
$tool = CAT_Helper_Addons::getAddonDetails($get_tool);
// Set toolname
$tpl_data['TOOL_NAME'] = $tool['name'];
$parser->setGlobals('TOOL_URL', CAT_ADMIN_URL . '/admintools/tool.php?tool=' . $tool['directory']);
// Check if folder of tool exists
if (file_exists(CAT_PATH . '/modules/' . $tool['directory'] . '/tool.php')) {
    // load language file (if any)
    $langfile = CAT_Helper_Directory::sanitizePath(CAT_PATH . '/modules/' . $tool['directory'] . '/languages/' . LANGUAGE . '.php');
    if (file_exists($langfile)) {
        if (!$backend->lang()->checkFile($langfile, 'LANG', true)) {
            // old fashioned language file
            require $langfile;
        } else {
            // modern language file
            $backend->lang()->addFile(LANGUAGE . '.php', CAT_Helper_Directory::sanitizePath(CAT_PATH . '/modules/' . $tool['directory'] . '/languages'));
        }
Beispiel #2
0
    include CAT_PATH . '/framework/class.secure.php';
} else {
    $root = "../";
    $level = 1;
    while ($level < 10 && !file_exists($root . '/framework/class.secure.php')) {
        $root .= "../";
        $level += 1;
    }
    if (file_exists($root . '/framework/class.secure.php')) {
        include $root . '/framework/class.secure.php';
    } else {
        trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
    }
}
if (!isset($module_version)) {
    $details = CAT_Helper_Addons::getAddonDetails('wrapper');
    $module_version = $details['version'];
}
if (!CAT_Helper_Addons::versionCompare($module_version, '2.7.2', '>=')) {
    $database->query('ALTER TABLE `' . CAT_TABLE_PREFIX . 'mod_wrapper` CHANGE COLUMN `type` `wtype` VARCHAR(50) NOT NULL DEFAULT \'iframe\' AFTER `width`;');
}
if (!CAT_Helper_Addons::versionCompare($module_version, '2.7.5', '>=')) {
    $database->query('ALTER TABLE `' . CAT_TABLE_PREFIX . 'mod_wrapper`
	CHANGE COLUMN `height` `height` VARCHAR(50) NOT NULL DEFAULT \'400\' AFTER `url`,
	CHANGE COLUMN `width` `width` VARCHAR(50) NOT NULL DEFAULT \'100%\' AFTER `height`;');
}
if (!CAT_Helper_Addons::versionCompare($module_version, '2.7.5', '>=')) {
    $database->query('ALTER TABLE `' . CAT_TABLE_PREFIX . 'mod_wrapper`
	CHANGE COLUMN `url` `url` TEXT NULL;');
}
// remove old template files