<?php
error_reporting(0);
session_start();
date_default_timezone_set('PRC');
header("Content-type: text/html; charset=utf-8");
$gmcode='1';
$accdbname="account";
$quarr = array (
 "10001" => array (
  "manageurl"=>"http://127.0.0.1:88/",//请以/结尾
  "gid"=>10000,
  "host"=>"127.0.0.1",
  "dbname"=>"ckwy_fy_S350002",
  //"user"=>"root",
  //"pwd"=>"123456",
  "zoneid"=>1,
  "name"=>"1区",
  //"manageuser"=>"shushen66",
  //"managepwd"=>"1692045",
  "hidde"=>false
 ),
  "10002" => array (
  "manageurl"=>"http://127.0.0.1:88/",//请以/结尾
  "gid"=>10000,
  "host"=>"127.0.0.1",
  "dbname"=>"ckwy_fy_S350003",
  "zoneid"=>2,
  "name"=>"2区",
  "hidde"=>false
 ),

);
if(isset($_POST['key'])){
	$api_sige=md5('603984007'.date('Y-m-d H'));
		if($_POST['key']==$api_sige){
		$return[]=array(
			'server_id'=>10001,
			'server_host'=>'101.34.86.67',
			'server_name'=>'天龙1-10区'
		);
		$return[]=array(
			'server_id'=>10011,
			'server_host'=>'101.34.86.67',
			'server_name'=>'天龙11-20区'
		);
		$return[]=array(
			'server_id'=>10021,
			'server_host'=>'101.34.86.67',
			'server_name'=>'天龙21-22区'
		);
		$return[]=array(
			'server_id'=>10023,
			'server_host'=>'101.34.86.67',
			'server_name'=>'天龙23-24区'
		);
		$return[]=array(
			'server_id'=>10025,
			'server_host'=>'101.34.86.67',
			'server_name'=>'天龙25区'
		);
		$return[]=array(
			'server_id'=>10026,
			'server_host'=>'101.34.86.67',
			'server_name'=>'天龙26区'
		);
		exit(json_encode($return));
	}
}

$getfilter="'|(and|or)\\b.+?(>|<|=|in|like)|\\/\\*.+?\\*\\/|<\\s*script\\b|\\bEXEC\\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)";
$postfilter="\\b(and|or)\\b.{1,6}?(=|>|<|\\bin\\b|\\blike\\b)|\\/\\*.+?\\*\\/|<\\s*script\\b|\\bEXEC\\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)";
$cookiefilter="\\b(and|or)\\b.{1,6}?(=|>|<|\\bin\\b|\\blike\\b)|\\/\\*.+?\\*\\/|<\\s*script\\b|\\bEXEC\\b|UNION.+?SELECT|UPDATE.+?SET|INSERT\\s+INTO.+?VALUES|(SELECT|DELETE).+?FROM|(CREATE|ALTER|DROP|TRUNCATE)\\s+(TABLE|DATABASE)";
function StopAttack($StrFiltKey,$StrFiltValue,$ArrFiltReq){
	if(is_array($StrFiltValue)){
		$StrFiltValue=implode($StrFiltValue);
	}
	if (preg_match("/".$ArrFiltReq."/is",$StrFiltValue)==1){
		print "非法操作!";
		exit();
	}
}
foreach($_GET as $key=>$value){
	StopAttack($key,$value,$getfilter);
}
foreach($_POST as $key=>$value){
	StopAttack($key,$value,$postfilter);
}
foreach($_COOKIE as $key=>$value){
	StopAttack($key,$value,$cookiefilter);
}
function poststr($str){
 if(isset($_POST[$str])){
  return $_POST[$str];
 }
die("您提交的参数非法！");
}
function get($url,$postdata){
		$ch = curl_init(); 
		curl_setopt($ch, CURLOPT_URL, $url.'?'.http_build_query($postdata)); 
		curl_setopt($ch, CURLOPT_HEADER, 0); 
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); 
		curl_setopt($ch, CURLOPT_TIMEOUT, 10);
		$output = curl_exec($ch);
		$errorCode = curl_errno($ch);
		return $output;
	}
?>