<?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__));

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

include(ROOT_PATH."/global.php");
include(ROOT_PATH."/data/rwriteurl.php");
if(WEB_STATE == '0') {
	exit(WEB_CLOSE_INFO);
}

define("MOD_PATH",ROOT_PATH."/model");
define("TPL_PATH",ROOT_PATH."/templates/default");
define("ADMIN_MOD_PATH",ROOT_PATH."/admin/model");
define("SHOW_TYPE","front");

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

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

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

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