<?php
include("libs.php");
include(dirname(dirname(__FILE__))."/./configs/config.php");
include(dirname(dirname(__FILE__))."/./configs/db_config.php");
include(dirname(dirname(__FILE__))."/./includes/class.inc.php");
include(dirname(dirname(__FILE__))."/./includes/function.php");
header("Content-Type:text/html;charset=utf-8");
session_start();
date_default_timezone_set('PRC');
$phpcolor = new mysql();
$phpcolor->open($core_mysql_host,$core_mysql_user,$core_mysql_pw,$core_mysql_dbname);
if(isset($_COOKIE['core_user_name']) && $_COOKIE['core_user_rank']=="2")
{
  $phpcolor->table=$core_mysql_prefix."user";
  $phpcolor->field="passwd,rank";
  $phpcolor->where="username='".$_COOKIE['core_user_name']."'";
  $userv=$phpcolor->exist(1);
  if($_COOKIE["core_user_passwd"]!=md5($userv['passwd'].$core_scode) || $_COOKIE["core_user_rank"]!=$userv['rank'])
    Header("Location: login.php?action=quit");
  else
    $tpl -> assign("core_user_name", $_COOKIE["core_user_name"]);
}
else
{
  Header("Location: login.php?action=login");
  exit();
}
$tpl -> display("top.htm");
?>