<?php
header("Cache-Control: no-cache, must-revalidate");
require_once dirname(__FILE__)."/inc.php";
$this_go_url=$web_url;
if(isset($get_go_url)){
	$this_go_url=$get_go_url;
}else{
	if(isset($_SERVER["HTTP_REFERER"])) $this_go_url=$_SERVER["HTTP_REFERER"];
}
if($get_act=="exit")
{
	$obj_ctl_user->on_exit();
	$get_act="";
	go_url($this_go_url);
}

if($obj_ctl_user->is_login()){
	if($obj_ctl_user->type=="company"){
		go_url($web_url."/company.php");
		exit;
	}else if($obj_ctl_user->type=="personal"){
		go_url($web_url."/user.php");
		exit;
	}
	go_url($web_url);
	exit;
}
if($get_act=="login")
{
	$lng_is_err=0;
	if(!isset($get_go_url)) $get_go_url="login.php";
	if($lng_is_err==0){
		$arr_fields=array();
		$arr_fields["uname"]=$get_uname;
		$arr_fields["pwd"]=$get_pwd;
		if(isset($get_code)) $arr_fields["verify_code"]=$get_code;
		$arr_return=$obj_ctl_user->on_login($arr_fields);
		if($arr_return["err"]!="")
		{
			$obj_msg->alert($arr_return["err"]);
		}else{
			go_url($this_go_url);
		}
	}
}

require_once WEB_ROOT.'/sys/fun/fun.temp.php';
if($get_app!="company_login") $get_app="user_login";
$str_temp=temp_load("/".$str_temp_path.$get_app);
if(is_file($str_temp)){
	include $str_temp;
}else{
	echo "ÎÄ¼þ²»´æÔÚ£¡";
}
?>
