fix gh-int

hotfix/paypal-note
LMR 3 years ago
parent 1046b4fd95
commit 7713d8d883

@ -36,7 +36,7 @@ switch ($_SERVER['SERVER_NAME']) {
$base_url = 'https://int.mycht.cn'; $base_url = 'https://int.mycht.cn';
break; break;
case 'gh-int.mycht.cn': case 'gh-int.mycht.cn':
$base_url = 'https://gh-int.mycht.cn'; $base_url = 'https://int.mycht.cn';
break; break;
case 'origin-gh.mycht.cn': case 'origin-gh.mycht.cn':
$base_url = 'https://gh.mycht.cn'; $base_url = 'https://gh.mycht.cn';

@ -1,142 +1,151 @@
<?php header('Cache-Control: no-cache'); ?> <?php header('Cache-Control: no-cache'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head >
<title>China Highlights Media Center</title>
<style type="text/css">
html,body,iframe {
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
width: 100%;
}
iframe {
overflow: auto;
}
</style>
</head>
<body>
<script type="text/javascript">
function SetReturnValue(s) {
if (s) {
window.parent.returnValue = s;
}
if (!!this.opener.callBack) {
this.opener.callBack(s);
}
window.parent.close();
}
this.opener.callBack = window.opener ? window.opener.CallBack: window.parent.CallBack;
</script> <head>
<?php <title>China Highlights Media Center</title>
$media_site_code='ch'; <style type="text/css">
if (isset($_GET['site_code'])){ html,
switch ($_GET['site_code']){ body,
case 'cht': iframe {
$media_site_code='ch'; height: 100%;
break; margin: 0;
case 'gm': overflow: hidden;
$media_site_code='ge'; padding: 0;
break; width: 100%;
case 'it': }
$media_site_code='it';
break; iframe {
case 'jp': overflow: auto;
$media_site_code='jp'; }
break; </style>
case 'ru': </head>
$media_site_code='ru';
break; <body>
case 'vac': <script type="text/javascript">
$media_site_code='sp'; function SetReturnValue(s) {
break; if (s) {
case 'vc': window.parent.returnValue = s;
$media_site_code='fr'; }
break; if (!!this.opener.callBack) {
case 'ct': this.opener.callBack(s);
$media_site_code='ct';
break;
case 'mbj':
$media_site_code='bj';
break;
case 'sht':
$media_site_code='sh';
break;
case 'yz':
$media_site_code='yz';
break;
case 'gl':
$media_site_code='gl';
break;
case 'tbt':
$media_site_code='tb';
break;
default:
$media_site_code='ch';
}
} }
window.parent.close();
}
this.opener.callBack = window.opener ? window.opener.CallBack : window.parent.CallBack;
</script>
<?php
$media_site_code = 'ch';
if (isset($_GET['site_code'])) {
switch ($_GET['site_code']) {
case 'cht':
$media_site_code = 'ch';
break;
case 'gm':
$media_site_code = 'ge';
break;
case 'it':
$media_site_code = 'it';
break;
case 'jp':
$media_site_code = 'jp';
break;
case 'ru':
$media_site_code = 'ru';
break;
case 'vac':
$media_site_code = 'sp';
break;
case 'vc':
$media_site_code = 'fr';
break;
case 'ct':
$media_site_code = 'ct';
break;
case 'mbj':
$media_site_code = 'bj';
break;
case 'sht':
$media_site_code = 'sh';
break;
case 'yz':
$media_site_code = 'yz';
break;
case 'gl':
$media_site_code = 'gl';
break;
case 'tbt':
$media_site_code = 'tb';
break;
default:
$media_site_code = 'ch';
}
}
/* /*
$_SERVER["REMOTE_ADDR"]!=='221.7.151.34' && $_SERVER["REMOTE_ADDR"]!=='221.7.151.43' && $_SERVER["REMOTE_ADDR"]!=='111.59.90.31' && $_SERVER["REMOTE_ADDR"]!=='221.7.151.41' && $_SERVER["REMOTE_ADDR"]!=='116.251.208.170' && $_SERVER["REMOTE_ADDR"]!=='221.7.151.39' $_SERVER["REMOTE_ADDR"]!=='221.7.151.34' && $_SERVER["REMOTE_ADDR"]!=='221.7.151.43' && $_SERVER["REMOTE_ADDR"]!=='111.59.90.31' && $_SERVER["REMOTE_ADDR"]!=='221.7.151.41' && $_SERVER["REMOTE_ADDR"]!=='116.251.208.170' && $_SERVER["REMOTE_ADDR"]!=='221.7.151.39'
*/ */
function is_remote_ip() function is_remote_ip()
{ {
$ip_list=''; $ip_list = '';
if(isset($_SERVER["REMOTE_ADDR"]))$ip_list=$_SERVER["REMOTE_ADDR"].' '; if (isset($_SERVER["REMOTE_ADDR"])) $ip_list = $_SERVER["REMOTE_ADDR"] . ' ';
if(isset($_SERVER["HTTP_X_FORWARDED_FOR"]))$ip_list.=$_SERVER["HTTP_X_FORWARDED_FOR"]; if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) $ip_list .= $_SERVER["HTTP_X_FORWARDED_FOR"];
//$ip_list=$_SERVER["REMOTE_ADDR"].' '.$_SERVER["HTTP_X_FORWARDED_FOR"]; //$ip_list=$_SERVER["REMOTE_ADDR"].' '.$_SERVER["HTTP_X_FORWARDED_FOR"];
//print_r($_SERVER); //print_r($_SERVER);
echo '<!--'.$ip_list.'-->'; echo '<!--' . $ip_list . '-->';
if (
stripos($ip_list, '202.103.68.34') !== false
|| stripos($ip_list, '221.7.151.39') !== false
|| stripos($ip_list, '221.7.151.37') !== false
|| stripos($ip_list, '221.7.151.41') !== false
|| stripos($ip_list, '111.59.90.31') !== false
|| stripos($ip_list, '180.140.114.225') !== false
|| stripos($ip_list, '116.8.4.34') !== false
|| stripos($ip_list, '180.140.114.208') !== false
|| stripos($ip_list, '116.8.4.34') !== false
|| stripos($ip_list, '::1') !== false //这个也是本地IP
) {
return false;
}
return true;
}
if (stripos($ip_list,'202.103.68.34')!==false //CDN分发之后源站和前端域名不一致在这里修正否则程序生成的链接是源站的域名
|| stripos($ip_list,'221.7.151.39')!==false $base_url = '';
|| stripos($ip_list,'221.7.151.37')!==false switch ($_SERVER['SERVER_NAME']) {
|| stripos($ip_list,'221.7.151.41')!==false case 'origin-ct.mycht.cn':
|| stripos($ip_list,'111.59.90.31')!==false $base_url = 'https://ct.mycht.cn';
|| stripos($ip_list,'180.140.114.225')!==false break;
|| stripos($ip_list,'116.8.4.34')!==false case 'origin-gm.mycht.cn':
|| stripos($ip_list,'180.140.114.208')!==false $base_url = 'https://gm.mycht.cn';
|| stripos($ip_list,'116.8.4.34')!==false break;
|| stripos($ip_list,'::1')!==false //这个也是本地IP case 'origin-cht.mycht.cn':
){ $base_url = 'https://cht.mycht.cn';
return false; break;
case 'origin-int.mycht.cn':
$base_url = 'https://int.mycht.cn';
case 'gh-int.mycht.cn':
$base_url = 'https://int.mycht.cn';
break;
default:
$base_url = 'https://' . $_SERVER['HTTP_HOST'];
} }
return true;
}
//CDN分发之后源站和前端域名不一致在这里修正否则程序生成的链接是源站的域名 ?>
$base_url=''; <?php
switch ($_SERVER['SERVER_NAME']){ if (isset($_GET['rwidth'])) {
case 'origin-ct.mycht.cn': $rwidth = 'rwidth=' . $_GET['rwidth'] . '&';
$base_url='https://ct.mycht.cn'; } else {
break; $rwidth = '';
case 'origin-gm.mycht.cn': } ?>
$base_url='https://gm.mycht.cn'; <?php if (isset($_GET['remote']) || is_remote_ip()) { ?>
break; <iframe id="test" frameborder="0" src="https://media-center.mycht.cn/OutputApp/searchpicture.aspx?<?php echo ($rwidth); ?>webcode=<?php echo $media_site_code; ?>&lgc=<?php echo $_GET['site_lgc']; ?>&apptype=translate&uname=ycc&upass=ycc&lmisn=1&WebUrl=<?php echo isset($_GET['WebUrl']) ? $_GET['WebUrl'] : false; ?>&redirecturl=<?php echo $base_url; ?>/media/transitval.php"> </iframe>
case 'origin-cht.mycht.cn': <?php } else { ?>
$base_url='https://cht.mycht.cn'; <iframe id="test" frameborder="0" src="https://video.chtcdn.com/OutputApp/searchpicture.aspx?<?php echo ($rwidth); ?>webcode=<?php echo $media_site_code; ?>&lgc=<?php echo $_GET['site_lgc']; ?>&apptype=infomation&WebUrl=<?php echo isset($_GET['WebUrl']) ? $_GET['WebUrl'] : false; ?>&redirecturl=<?php echo $base_url; ?>/media/transitval.php"> </iframe>
break; <?php } ?>
case 'origin-int.mycht.cn': </body>
$base_url='https://int.mycht.cn';
break;
default:$base_url='https://'.$_SERVER['HTTP_HOST'];
}
?>
<?php
if (isset($_GET['rwidth'])) {
$rwidth = 'rwidth='.$_GET['rwidth'].'&';
} else {
$rwidth = '';
}?>
<?php if (isset($_GET['remote']) || is_remote_ip()){ ?>
<iframe id="test" frameborder="0" src="https://media-center.mycht.cn/OutputApp/searchpicture.aspx?<?php echo($rwidth);?>webcode=<?php echo $media_site_code; ?>&lgc=<?php echo $_GET['site_lgc'];?>&apptype=translate&uname=ycc&upass=ycc&lmisn=1&WebUrl=<?php echo isset($_GET['WebUrl'])?$_GET['WebUrl']:false;?>&redirecturl=<?php echo $base_url; ?>/media/transitval.php" > </iframe>
<?php }else{ ?>
<iframe id="test" frameborder="0" src="https://video.chtcdn.com/OutputApp/searchpicture.aspx?<?php echo($rwidth);?>webcode=<?php echo $media_site_code; ?>&lgc=<?php echo $_GET['site_lgc'];?>&apptype=infomation&WebUrl=<?php echo isset($_GET['WebUrl'])?$_GET['WebUrl']:false;?>&redirecturl=<?php echo $base_url; ?>/media/transitval.php" > </iframe>
<?php } ?>
</body>
</html> </html>

@ -108,7 +108,7 @@ switch ($sitecode) {
//文件上传目录,使用相对路径,在文件夹中建立虚拟目录指向真实文件夹 //文件上传目录,使用相对路径,在文件夹中建立虚拟目录指向真实文件夹
//创建指向目录 mklink /D D:\wwwroot\uploader-file\gh\image D:\wwwroot\origin-www.globalhighlights.com\image //创建指向目录 mklink /D D:\wwwroot\uploader-file\gh\image D:\wwwroot\origin-www.globalhighlights.com\image
//需要移出项目文件夹防止FTP访问到防止误删 //需要移出项目文件夹防止FTP访问到防止误删
if ('origin-int.mycht.cn' == $_SERVER["SERVER_NAME"] || 'origin-gm.mycht.cn' == $_SERVER["SERVER_NAME"]) { if ('gh-int.mycht.cn' == $_SERVER["SERVER_NAME"] || 'origin-gm.mycht.cn' == $_SERVER["SERVER_NAME"]) {
// 国际站和德语站不需要更改目录 // 国际站和德语站不需要更改目录
$site_upload_dir = dirname(__FILE__) . ('/userfiles/') . $sitecode; $site_upload_dir = dirname(__FILE__) . ('/userfiles/') . $sitecode;
} else { } else {

Loading…
Cancel
Save