示例#1
0
文件: admin.php 项目: cbsistem/nexos
    JS::add('includes/javascript/JSCookMenu.js');
    JS::add('themes/default/javascript/cookmenu.js');
    CSS::add('themes/default/style/cookmenu.css');
}
global $CPG_SESS;
if ($op == 'logout') {
    unset($CPG_SESS['admin']);
    $redir = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $mainindex;
    cpg_error(_YOUARELOGGEDOUT, _ADMINMENU_LOGOUT, $redir);
} else {
    if ($CLASS['member']->admin_id) {
        if (!preg_match('#^([a-zA-Z0-9_\\-]+)$#', $op)) {
            cpg_error(sprintf(_ERROR_BAD_CHAR, strtolower(_ADMIN)), _SEC_ERROR);
        }
        $Module = new Module('Admin');
        Blocks::$showblocks = $Module->sides;
        $Blocks = new Blocks(-1);
        require_once CORE_PATH . 'classes/cpg_adminmenu.php';
        $CLASS['adminmenu']->display();
        if (file_exists('modules/' . $op . '/admin/index.inc')) {
            $file = isset($_GET['file']) ? $_GET['file'] : (isset($_POST['file']) ? $_POST['file'] : 'index');
            if (!preg_match('#^([a-zA-Z0-9_\\-]+)$#', $file)) {
                cpg_error(sprintf(_ERROR_BAD_CHAR, strtolower(_BLOCKFILE2)), _SEC_ERROR);
            }
            $module_name = $op;
            get_lang($op, -1);
            include 'modules/' . $op . '/admin/' . $file . '.inc';
            if (defined('HEADER_OPEN')) {
                require_once 'footer.php';
            } else {
                cpg_error('The requested file, modules/' . $op . '/admin/' . $file . '.inc, didn\'t output data correctly');