<?php
/***
*后台入口文件
*@package binzcms
*@version $id:index.php, v 1.0
*@author 斌子
*@Sat Jan 03 22:51:13 CST 2009
*@copyright (c) 2009-2010 binzcms
*
*/
error_reporting(7);
@header("Content-type: text/html; charset=utf-8");

define("BINZCMS",		true);
define("ROOT_PATH",		dirname(__FILE__)."/..");
define("ADMIN_MOD_PATH",ROOT_PATH."/admin/model");
define("TPL_PATH",		ROOT_PATH."/templates/admin");
define("ADMIN_LG",		true);
define("SHOW_TYPE",		"admin");

if(!file_exists(ROOT_PATH.'/data/install.lock')) {
	@header("Location: ../install/index.php");
	exit();
}

include_once(ROOT_PATH."/global.php");


$act = isset($_REQUEST['act']) ? trim($_REQUEST['act']): '';
$ctl = isset($_REQUEST['ctl']) ? basename($_REQUEST['ctl']): 'index';

if(!in_array($ctl,$admin_allows_ctl)) {
	die('hacking!');
}

/*登陆判断*/
if(empty($_SESSION['admin_name']) and empty($_SESSION['admin_id'])) {
	$act	= 'admin_login';
	$ctl	= 'index';
}

$ctl_class	= "Admin".ucfirst($ctl)."Class";
include(ROOT_PATH."/admin/class/".$ctl_class.".php");

$controller = new $ctl_class($act);
?>