예제 #1
0
파일: plugin.php 프로젝트: hxj524/bljtsys
    $dou->dou_msg($_LANG['plugin_edit_succes'], 'plugin.php');
} elseif ($rec == 'disable') {
    // 验证并获取合法的ID
    $unique_id = $check->is_extend_id($_REQUEST['unique_id']) ? $_REQUEST['unique_id'] : '';
    $name = $dou->get_one("SELECT name FROM " . $dou->table('plugin') . " WHERE unique_id = '{$unique_id}'");
    $dou->create_admin_log($_LANG['plugin_disable_succes'] . ': ' . $name);
    $dou->delete($dou->table('plugin'), "unique_id = '{$unique_id}'");
    $dou->dou_header('plugin.php');
} elseif ($rec == 'del') {
    if ($check->is_extend_id($unique_id = $_REQUEST['unique_id'])) {
        // 载入扩展功能
        include_once ROOT_PATH . ADMIN_PATH . '/include/cloud.class.php';
        $dou_cloud = new Cloud('cache');
        if (isset($_POST['confirm']) ? $_POST['confirm'] : '') {
            $plugin_array = $dou->get_subdirs($plugin_dir);
            if (in_array($unique_id, $plugin_array)) {
                // 判断删除操作的插件是否真实存在
                $dou->del_dir($plugin_dir . $unique_id);
                $dou_cloud->change_updatedate('plugin', $unique_id, true);
                // 删除更新时间记录
                $dou->create_admin_log($_LANG['plugin_del'] . ': ' . $unique_id);
                $dou->dou_header('plugin.php');
            }
        } else {
            $_LANG['del_check'] = preg_replace('/d%/Ums', $unique_id, $_LANG['del_check']);
            $dou->dou_msg($_LANG['del_check'], 'plugin.php', '', '30', "plugin.php?rec=del&unique_id={$unique_id}");
        }
    } else {
        $dou->dou_header('plugin.php');
    }
}
예제 #2
0
파일: theme.php 프로젝트: bqx619/zn_douphp
 * 模板启用
 * +----------------------------------------------------------
 */
if ($rec == 'enable') {
    if ($check->is_extend_id($unique_id = $_REQUEST['unique_id'])) {
        $theme_array = $dou->get_subdirs(ROOT_PATH . 'theme/');
        if (in_array($unique_id, $theme_array)) {
            // 判断删除操作的模板是否真实存在
            // 替换系统设置中模板值
            $dou->query("UPDATE " . $dou->table('config') . " SET value = '{$unique_id}' WHERE name = 'site_theme'");
            $dou->dou_clear_cache(ROOT_PATH . "cache");
            // 更新缓存
        }
    }
    $dou->dou_header('theme.php');
} elseif ($rec == 'del') {
    // 载入扩展功能
    include_once ROOT_PATH . ADMIN_PATH . '/include/cloud.class.php';
    $dou_cloud = new Cloud('cache');
    if ($check->is_extend_id($unique_id = $_REQUEST['unique_id'])) {
        $theme_array = $dou->get_subdirs(ROOT_PATH . 'theme/');
        if (in_array($unique_id, $theme_array)) {
            // 判断删除操作的模板是否真实存在
            $dou->del_dir(ROOT_PATH . 'theme/' . $unique_id);
            $dou_cloud->change_updatedate('theme', $unique_id, true);
            // 删除更新时间记录
            $dou->create_admin_log($_LANG['theme_del'] . ': ' . $unique_id);
        }
    }
    $dou->dou_header('theme.php');
}
예제 #3
0
 */
if ($rec == 'del') {
    // 载入扩展功能
    include_once ROOT_PATH . ADMIN_PATH . '/include/cloud.class.php';
    $dou_cloud = new Cloud('cache');
    // CSRF防御令牌验证
    $firewall->check_token($_REQUEST['token'], 'module_uninstall');
    if ($check->is_extend_id($extend_id = $_REQUEST['extend_id'])) {
        $module_zip = $cache_dir . $extend_id . '.zip';
        // 模块压缩包
        $module_dir = $cache_dir . $extend_id;
        // 模块目录
        if ($dou_cloud->file_unzip($module_zip, $module_dir)) {
            $dou_cloud->modify_theme_dir($module_dir);
            // 将解压得到的扩展目录中的模板文件夹名改成当前启用的模板文件夹名
            $dou_cloud->clear_module($extend_id);
            $dou_cloud->change_updatedate('module', $extend_id, true);
            // 删除更新时间记录
            $dou->del_dir($module_dir);
            @unlink($module_zip);
            $dou->query("DELETE FROM " . $dou->table('nav') . " WHERE module = '{$extend_id}'");
            $dou->query("DELETE FROM " . $dou->table('nav') . " WHERE module = '{$extend_id}" . "_category'");
            $dou->create_admin_log($_LANG['module_uninstall_success'] . ': ' . $extend_id);
            $dou->dou_header('module.php?rec=uninstall');
        } else {
            $dou->dou_msg($_LANG['module_unzip_wrong'], 'module.php?rec=uninstall');
        }
    } else {
        $dou->dou_msg($_LANG['module_uninstall_wrong'], 'module.php?rec=uninstall');
    }
}
예제 #4
0
                $dou->query("UPDATE " . $dou->table('config') . " SET value = '{$unique_id}' WHERE name = 'mobile_theme'");
                $dou->dou_clear_cache(ROOT_PATH . 'cache/m');
                // 更新缓存
            }
        }
        $dou->dou_header('mobile.php?rec=theme');
    } elseif ($act == 'del') {
        // 载入扩展功能
        include_once ROOT_PATH . ADMIN_PATH . '/include/cloud.class.php';
        $dou_cloud = new Cloud('cache');
        if ($check->is_extend_id($unique_id = $_REQUEST['unique_id'])) {
            $theme_array = $dou->get_subdirs(ROOT_PATH . M_PATH . '/theme/');
            if (in_array($unique_id, $theme_array)) {
                // 判断删除操作的模板是否真实存在
                $dou->del_dir(ROOT_PATH . M_PATH . '/theme/' . $unique_id);
                $dou_cloud->change_updatedate('mobile', $unique_id, true);
                // 删除更新时间记录
                $dou->create_admin_log($_LANG['mobile_theme_del'] . ': ' . $unique_id);
            }
        }
        $dou->dou_header('mobile.php?rec=theme');
    }
}
/**
 * +----------------------------------------------------------
 * 获取系统设置列表
 * +----------------------------------------------------------
 */
function get_cfg_list($tab = 'main')
{
    $sql = "SELECT * FROM " . $GLOBALS['dou']->table('config') . " WHERE tab = 'mobile' ORDER BY sort ASC";