<?php
/*
Runtime Envirment file
位置: /passport
*/
require('../rte.php');
define('MODULE','passport');
define('WORK_DIR',ROOT.MODULE."/");
require(WORK_DIR.'config/baseconfig.php');
$Lang -> LoadLangFromFile('i18n_passport');
Iimport('PassPort_User');
$passport = new PassPort_User();
$passport -> ExitLogin();

if ($rtc['uc_use']) {
	require_once(WORK_DIR.'config.uc.php');
	include_once WORK_DIR.'uc_client/client.php';
	$ucsynlogout = uc_user_synlogout();
	$return = $return ? $return : ($forward ? $forward : '');
	if(!$return) {
		if($_SERVER['HTTP_REFERER']) {
			$return = $_SERVER['HTTP_REFERER'];
		}else {
			$return = './';
		}
	}
	ShowMessage('logout.success'.$ucsynlogout,$return,0,1);
}

//passport api
if ($base_config['passport_method'] == 2) {	
	#变量约定
	//动作标记
	$inter_action = 'quit';
	//传送数据
	$inter_db = array(
		'username' => '',
		'password'=> '',
		'email' => '',
		'time' => $timestamp,
	);
	//跳转地址
	$forward = $return ? $return : $forward;
	$inter_forward = $forward ? $forward : $base_config['passport_root'];
	//验证签名,在模块中计算.
	$Inter_verify = '';
	#变量约定
	
	$interface_file = WORK_DIR.'api/passport_interface/'.$base_config['passport_api_program'].'_interface.php';
	if (file_exists($interface_file)) {
		define('passport_safe',1);
		require($interface_file);
	}
}
//passport api
$return = $return ? $return : ($forward ? $forward : '');
if($return) {
	ShowMessage('success',$return,0,0);
}else {
	if($_SERVER['HTTP_REFERER']) {
		$return = $_SERVER['HTTP_REFERER'];
	}else {
		$return = './';
	}
	ShowMessage('success',$return,0,0);
}
?>