Ejemplo n.º 1
0
function get_admin_header()
{
    if (!isset($GLOBALS['page_type'][0])) {
        $GLOBALS['page_type'][0] = 1;
    }
    if (!isset($GLOBALS['page_type'][1])) {
        $GLOBALS['page_type'][1] = 1;
    }
    include_once ROOT . '/template/header.php';
    if (!check_power()) {
        get_forbid_page();
    }
}
Ejemplo n.º 2
0
function module_main()
{
    global $global, $smarty;
    $cmd = post('cmd');
    if ($global['admin_id'] > 0) {
        $smarty->assign('show_main', 1);
        if ($cmd == '') {
            $smarty->assign('show_info', 0);
            if (check_power()) {
                $smarty->assign('check_power', 1);
                if ($global['mod'] != 'main') {
                    $path = 'admin/module/' . $global['channel'] . '/' . $global['mod'] . '.php';
                    if (!file_exists($path)) {
                        $path = 'admin/module/' . $global['original'] . '/' . $global['mod'] . '.php';
                    }
                    include $path;
                    $func = 'module_' . $global['mod'];
                    $func();
                }
            } else {
                $smarty->assign('check_power', 0);
            }
        } else {
            $smarty->assign('show_info', 1);
            $smarty->assign('check_power', 1);
            $path = 'admin/module/' . $global['channel'] . '/deal.php';
            if (!file_exists($path)) {
                $path = 'admin/module/' . $global['original'] . '/deal.php';
            }
            include $path;
            $cmd();
        }
    } else {
        $smarty->assign('show_main', 0);
    }
}
Ejemplo n.º 3
0
<?php

include 'function.php';
$power = check_power();
$help = "";
if ($power == 1) {
    echo '网站目录写入权限不足,请更改权限后重试!' . $help;
} elseif ($power == 2) {
    echo '网站目录修改权限不足,请更改权限后重试!' . $help;
} elseif (!function_exists('scandir')) {
    echo 'scandir()函数不可用,请修改服务器配置后重试!' . $help;
} else {
    switch (post('db_type')) {
        case 'mysql':
            $db_host = post('db_host');
            $db_name = post('db_name');
            $db_user = post('db_user');
            $db_pass = post('db_pass');
            $db_prefix = post('db_prefix');
            if ($db_host == '' || $db_name == '' || $db_user == '') {
                echo '数据库信息不足!' . $help;
            } elseif (@mysql_connect($db_host, $db_user, $db_pass)) {
                if (mysql_select_db($db_name)) {
                    if (mysql_query("select * from " . $db_prefix . "varia")) {
                        echo '检测到数据表已存在,如果您之前已经安装过一次,重新安装之前请先清空数据库或更换数据表前缀。' . $help;
                    } else {
                        echo 1;
                    }
                } else {
                    echo 1;
                }
Ejemplo n.º 4
0
     if (isset($_GET['id']) && is_number($_GET['id'])) {
         $u = new user();
         $status = $u->change_active($_GET['id'], 1);
         if ($status != 'OK') {
             die(html_jump($form_url . "&status=" . $status));
         } else {
             die(html_jump($form_url . "&status=OK"));
         }
     } else {
         die(html_jump($form_url . "&status=ID参数有误"));
     }
     break;
     //删除账户
 //删除账户
 case 'del':
     if (!check_power(array(1))) {
         die(html_jump($form_url . "&status=非法操作"));
     }
     if (isset($_GET['id']) && is_number($_GET['id'])) {
         $user_del = new user_del();
         $status = $user_del->add($_GET['id']);
         if ($status != 'OK') {
             die(html_jump($form_url . "&status=" . $status));
         } else {
             $status = $user_del->del();
             die(html_jump($form_url . "&status=" . $status));
         }
     } else {
         die(html_jump($form_url . "&status=ID参数有误"));
     }
     break;