<?php
/* 蹇嵎鍟嗗煄绯荤粺
 * 鐗堟湰鍙凤細2.0
 * 瀹樼綉锛歨ttp://www.kjcms.cn
 * 2015-02-16
 */
require "inc.php";
if(!file_exists(KJ_DIR_DATA."/install.inc")){
	fun_base::url_jump("install.php");
	exit;
}


//是否整合微信
if(fun_is::set("app_weixin")) {
	$certify = cls_config::get("certify" , 'weixin' , '' ,'');
	if($certify == 1 && cls_obj::get("cls_user")->is_login() == false) {//未登录则自动跳转微信登录
		$url = cls_config::get("url");
		$jump_url = fun_get::url(array('app_weixin'=>''));
		$jump_url = urlencode($url . $jump_url);
		fun_base::url_jump( $url . '/common.php?app=api.login&plat=weixin&jump_url=' . $jump_url);
		exit;
	}
}

$agent = fun_get::agent();
if(in_array($agent,array('','ipad'))) {
	$mod_dir = cls_config::get_env('mod_dir');
	$view_dir = cls_config::get_env('view_dir');
	cls_app::on_load($mod_dir , $view_dir);
} else {
	//目前手机支持的浏览器
	if(in_array($agent , array("qq","iphone","android"))) {
		cls_app::on_load("default" , "wap");
	} else {
		cls_app::on_load("default" , "wap" , array("app"=>'noagent' , "app_module"=>"" , "app_act"=>""));
	}
}