Exemple #1
0
if (in_array($userip, $RBB_CACHE['banip_S']) || in_array(implode('.', $cell), $RBB_CACHE['banip_D'])) {
    header("HTTP/1.1 403");
    exit;
}
$nowtime = time();
//包含必要的文件头,一定要放在注册全局变量之后
require_once '../config.php';
//设置
//require_once('../cache/ranking.php');//积分线
require_once '../cache/onlinerec.php';
//在线纪录
require_once '../include/functions.php';
//基本函数
require_once './admin_special.php';
//连接数据库
RenDB_Connect();
if (isset($admin_log_name, $admin_log_pass)) {
    setcookie('admin_name', $admin_log_name);
    setcookie('admin_pass', $admin_log_pass);
    ACP_MessageBox("登陆成功");
    //header('Location: index.php');
    exit;
}
//登陆
$admin_logged = false;
if (isset($_COOKIE['admin_name'], $_COOKIE['admin_pass'])) {
    if (In_Names($_COOKIE['admin_name'], $cfg['admins'])) {
        $admin_name = $_COOKIE['admin_name'];
        $admin_pass = md5($_COOKIE['admin_pass']);
        $sql = "SELECT * FROM `{$cfg['tb_members']}` WHERE u_name='{$admin_name}' AND u_pass='******' LIMIT 1";
        $result = RenDB_Query($sql);
unset($cell[3]);
if (in_array($userip, $RBB_CACHE['banip_S']) || in_array(implode('.', $cell), $RBB_CACHE['banip_D'])) {
    header("HTTP/1.1 403");
    exit;
}
require_once './config.php';
//设置
require_once './include/functions.php';
//基本函数
//require_once('./cache/ranking.php');//积分线
if ($cfg['debug_mode']) {
    //调试模式
    require_once './include/debug_mode.php';
}
//连接数据库
RenDB_Connect($cfg['pconnect']);
//全局变量
$fakename = '@' . $userip;
$nowtime = time();
$o_deadline = $nowtime - $cfg['span_online'];
if (isset($udata)) {
    unset($udata);
}
//必须保留
if (isset($_COOKIE['cook_name'], $_COOKIE['cook_pass'])) {
    //从cookies登陆
    $cook_name = addslashes($_COOKIE['cook_name']);
    $cook_pass = addslashes($_COOKIE['cook_pass']);
    //$sql="SELECT * FROM $cfg[tb_members] WHERE u_name='$cook_name' AND u_pass='******' LIMIT 1";
    $sql = "SELECT m.*,o.* FROM {$cfg['tb_members']} m LEFT JOIN {$cfg['tb_onlines']} o ON o.fake_name=m.u_name AND o.o_time>={$o_deadline} WHERE m.u_name='{$cook_name}' AND m.u_pass='******' LIMIT 1";
    $result = RenDB_Query($sql);