<?php
define('THIS_SCRIPT', 'passport');
include_once 'global.php';
define('PASSPORTPATH', CACHE_PATH.'passport.config.php');
include_once PASSPORTPATH;
if (defined('MAIN_DOMAIN_NAME')) {
	exit('0@@@Access denied!@@@');
}
$lang = load_lang($lang,'passport');
head();
checklogin();

if ( strpos($sysinfo['flag'],'58,') === false ){
	show_msg($lang['readme_tit'],$lang['passport.err1'],0,'','','','');
	exit;
}
PageLoad();
function Pageload(){
	global $lang,$reaction,$charset,$passport;
	if($reaction==="save"){
		global $_POST;
		if(!$fp=fopen(PASSPORTPATH,"wb")){
			show_msg("{$lang["passport.save"]}","{$lang["passport.save"]}{$lang["passport.fail"]}
			<BR>{$lang["passport.fail_case"]}",0,'','',"?","{$lang["passport.back"]}");

		}else{
			if(!$post_passport=$_POST['p']){
				show_msg("{$lang["passport.save"]}","{$lang["passport.save"]}{$lang["passport.fail"]}
			    <BR>{$lang["passport.fail_errpost"]}",0,'','',"?","{$lang["passport.back"]}");
			}else{
				$content="<?php\n".varstoscript("passport",$post_passport).";\n?>";
				fputs($fp,$content);
				@fclose($fp);
				show_msg("{$lang["passport.save"]}","{$lang["passport.save"]}{$lang["passport.ok"]}",1,'',''
				,"?","{$lang["passport.back"]}");


			}


		}
		exit;
	}

	include printout('passport');
	footer();
}
?>