Esempio n. 1
0
        $func = 'wysiwyg';
        $type = 'module';
        break;
    case 'template':
        $pre = 'template_';
        $func = 'template';
        break;
    case 'language':
        $func = 'language';
        $pre = 'language_';
        break;
    case 'module':
        $func = 'page';
        break;
}
$info = array($pre . 'name' => $name, $pre . 'directory' => $dir, $pre . 'type' => $type, $pre . 'function' => $func, $pre . 'description' => $desc, $pre . 'version' => '0.1', $pre . 'platform' => '1.x', $pre . 'author' => $author, $pre . 'guid' => CAT_Object::createGUID(), $pre . 'license' => 'GNU General Public License');
if ($type == 'language') {
    $info[$pre . 'code'] = $dir;
}
// create directories
if ($type != 'language') {
    if (!CAT_Helper_Directory::createDirectory($full)) {
        $message = $backend->lang()->translate('Directory could not be created!');
        printResult();
    }
    foreach (array('templates', 'css', 'js') as $sub) {
        CAT_Helper_Directory::createDirectory($full . '/' . $sub);
    }
    if ($type != 'module') {
        CAT_Helper_Directory::createDirectory($full . '/languages');
    }
Esempio n. 2
0
    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);
    }
}
ob_start();
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: text/html; charset:utf-8;");
$backend = CAT_Backend::getInstance('Settings', 'settings_basic');
$curr_user_is_admin = in_array(1, CAT_Users::getInstance()->get_groups_id());
if (!$curr_user_is_admin) {
    echo "<div style='border: 2px solid #CC0000; padding: 5px; text-align: center; background-color: #ffbaba;'>You're not allowed to use this function!</div>";
    exit;
}
$settings = array();
$sql = 'SELECT * FROM `' . CAT_TABLE_PREFIX . 'settings` WHERE name="guid"';
if ($res = $backend->db()->query($sql)) {
    $row = $res->fetchRow(MYSQL_ASSOC);
}
if (!isset($row['value']) || $row['value'] == '') {
    @(require_once CAT_PATH . '/framework/CAT/Object.php');
    $guid = CAT_Object::createGUID();
    $row['setting_id'] = isset($row['setting_id']) ? $row['setting_id'] : NULL;
    $backend->db()->query('REPLACE INTO `' . CAT_TABLE_PREFIX . 'settings` VALUES("' . $row['setting_id'] . '", "guid", "' . $guid . '")');
} else {
    $guid = $row['value'];
}
ob_clean();
echo $guid;