Esempio n. 1
0
foreach (cot_getextplugins('admin.cache.disk.first') as $pl) {
    include $pl;
}
/* ===== */
if ($a == 'purge') {
    if (cot_check_xg() && cot_diskcache_clearall()) {
        cot_message('adm_purgeall_done');
        // Empty resource consolidation cache
        $db->delete($db_cache, "c_name = 'cot_rc_html'");
    } else {
        cot_message('Error');
    }
} elseif ($a == 'delete') {
    $is_id = mb_strpos($id, '/') === false && mb_strpos($id, '\\') === false && $id != '.' && $id != '..';
    $is_onlyf = $id == COT_DISKCACHE_ONLYFILES;
    if (cot_check_xg() && $is_id && cot_diskcache_clear($cfg['cache_dir'] . ($is_onlyf ? '' : "/{$id}"), !$is_onlyf)) {
        cot_message('adm_delcacheitem');
        if ($id == 'static' || $is_onlyf) {
            // Empty resource consolidation cache
            $db->delete($db_cache, "c_name = 'cot_rc_html'");
        }
    } else {
        cot_message('Error');
    }
}
$row = cot_diskcache_list();
$cachefiles = $cachesize = 0;
$ii = 0;
/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('admin.cache.disk.loop');
/* ===== */
Esempio n. 2
0
    /* ===== */
    cot_trash_delete($id);
    cot_message('adm_trashcan_deleted');
    cot_redirect(cot_url('admin', 'm=other&p=trashcan', '', true));
} elseif ($a == 'wipeall') {
    cot_check_xg();
    /* === Hook === */
    foreach (cot_getextplugins('trashcan.admin.wipeall') as $pl) {
        include $pl;
    }
    /* ===== */
    $sql = $db->query("TRUNCATE {$db_trash}");
    cot_message('adm_trashcan_prune');
    cot_redirect(cot_url('admin', 'm=other&p=trashcan', '', true));
} elseif ($a == 'restore') {
    cot_check_xg();
    /* === Hook === */
    foreach (cot_getextplugins('trashcan.admin.restore') as $pl) {
        include $pl;
    }
    /* ===== */
    cot_trash_restore($id);
    cot_message('adm_trashcan_restored');
    cot_redirect(cot_url('admin', 'm=other&p=trashcan', '', true));
}
$tr_t = new XTemplate(cot_tplfile($info ? 'trashcan.info.admin' : 'trashcan.admin', 'plug', true));
$totalitems = (int) $db->query("SELECT COUNT(*) FROM {$db_trash} WHERE tr_parentid=0")->fetchColumn();
$pagenav = cot_pagenav('admin', 'm=other&p=trashcan', $d, $totalitems, $maxperpage, 'd', '', $cfg['jquery'] && $cfg['turnajax']);
$sql_query = $info ? "AND tr_id={$id} LIMIT 1" : "ORDER by tr_id DESC LIMIT {$d}, " . $maxperpage;
$sql = $db->query("SELECT t.*, u.user_name FROM {$db_trash} AS t\n\tLEFT JOIN {$db_users} AS u ON t.tr_trashedby=u.user_id\n\tWHERE tr_parentid=0 {$sql_query}");
$ii = 0;
Esempio n. 3
0
     $installed_plugins = $db->query("SELECT ct_code FROM {$db_core} WHERE ct_plug = 1")->fetchAll(PDO::FETCH_COLUMN);
     $dependencies_satisfied = cot_extension_dependencies_statisfied($code, $is_module, $installed_modules, $installed_plugins);
     if ($dependencies_satisfied) {
         $result = cot_extension_install($code, $is_module);
     }
     break;
 case 'update':
     $result = cot_extension_install($code, $is_module, true, true);
     break;
 case 'uninstall':
     /* === Hook  === */
     foreach (cot_getextplugins('admin.extensions.uninstall.first') as $pl) {
         include $pl;
     }
     /* ===== */
     if (cot_check_xg(false)) {
         // Check if there are extensions installed depending on this one
         $dependencies_satisfied = true;
         $res = $db->query("SELECT ct_code, ct_plug FROM {$db_core} ORDER BY ct_plug, ct_code");
         foreach ($res->fetchAll() as $row) {
             $ext = $row['ct_code'];
             $dir_ext = $row['ct_plug'] ? $cfg['plugins_dir'] : $cfg['modules_dir'];
             $dep_ext_info = $dir_ext . '/' . $ext . '/' . $ext . '.setup.php';
             if (file_exists($dep_ext_info)) {
                 $dep_info = cot_infoget($dep_ext_info, 'COT_EXT');
                 if (!$dep_info && cot_plugin_active('genoa')) {
                     // Try to load old format info
                     $dep_info = cot_infoget($dep_ext_info, 'SED_EXTPLUGIN');
                 }
                 $dep_field = $is_module ? 'Requires_modules' : 'Requires_plugins';
                 if (in_array($code, explode(',', $dep_info[$dep_field]))) {