<?php
/**
 * @Cscms 3.5 open source management system
 * @copyright 2009-2013 chshcms.com. All rights reserved.
 * @Author:Cheng Jie
 * @Dtime:2013-04-27
 */
@header('Content-Type: text/html; charset=gbk');
//判断是否安装
if(!file_exists(FCPATH.'csdj/install/install.lock') && strpos(@$_SERVER['REQUEST_URI'],'/install/') === FALSE){
	$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
	$url = substr($url,0,-9);
	$url .= 'index.php/install/';
	header("location:".$url);exit;
}
require_once 'Cs_Version.php';
require_once 'Cs_DB.php';
require_once 'Cs_Config.php';
require_once 'Cs_User.php';
require_once 'Cs_Pay.php';
require_once 'Cs_Email.php';
require_once 'Cs_Water.php';
require_once 'Cs_Rigin.php';
require_once 'Cs_Denglu.php';

//判断网站运行状态
if(strpos($_SERVER['REQUEST_URI'],SELF) === FALSE && Web_Off==1){
    die(stripslashes(html_entity_decode(Web_Onneir)));
}

//判断会员系统开关
if(strpos($_SERVER['REQUEST_URI'],SELF) === FALSE && strpos($_SERVER['REQUEST_URI'],'user') && User_Mode==2){
	die('本站会员系统已关闭!');
}


//判断手机客户端访问
$UA = strtoupper($_SERVER['HTTP_USER_AGENT']);
if(preg_match("/(iPhone|iPad|iPod|Android)/i", $UA) && file_exists("./plugins/wap/config.php") && strpos($_SERVER['REQUEST_URI'],'admin') === FALSE && strpos($_SERVER['REQUEST_URI'],'m/wap') === FALSE){
      $Wap_Url="http://".Web_Url.Web_Path."index.php/m/wap";
      header("location:".$Wap_Url);exit;
}
if(strpos($UA, 'WINDOWS NT') !== false && strpos($_SERVER['REQUEST_URI'],'m/wap')){
      $Web_Link=Web_Path."index.php/wap";
      header("location:".$Web_Link);exit;
}
