From 7713d8d8835a6808e7054291b565849b129e7a21 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 15 Mar 2022 09:09:45 +0800 Subject: [PATCH] fix gh-int --- application/config/config.php | 2 +- media/popselectpicture.php | 271 ++++++++++++++++++---------------- wysiwyg/ckfinder/config.php | 2 +- 3 files changed, 142 insertions(+), 133 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 4b86ddb4..87f1ba80 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -36,7 +36,7 @@ switch ($_SERVER['SERVER_NAME']) { $base_url = 'https://int.mycht.cn'; break; case 'gh-int.mycht.cn': - $base_url = 'https://gh-int.mycht.cn'; + $base_url = 'https://int.mycht.cn'; break; case 'origin-gh.mycht.cn': $base_url = 'https://gh.mycht.cn'; diff --git a/media/popselectpicture.php b/media/popselectpicture.php index 340047ac..25e3c71c 100644 --- a/media/popselectpicture.php +++ b/media/popselectpicture.php @@ -1,142 +1,151 @@ - - China Highlights Media Center - - - - - + China Highlights Media Center + + + + + + '; - - 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; +*/ + function is_remote_ip() + { + $ip_list = ''; + if (isset($_SERVER["REMOTE_ADDR"])) $ip_list = $_SERVER["REMOTE_ADDR"] . ' '; + if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) $ip_list .= $_SERVER["HTTP_X_FORWARDED_FOR"]; + //$ip_list=$_SERVER["REMOTE_ADDR"].' '.$_SERVER["HTTP_X_FORWARDED_FOR"]; + //print_r($_SERVER); + echo ''; + + 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; + } + + //CDN分发之后,源站和前端域名不一致在这里修正,否则程序生成的链接是源站的域名 + $base_url = ''; + switch ($_SERVER['SERVER_NAME']) { + case 'origin-ct.mycht.cn': + $base_url = 'https://ct.mycht.cn'; + break; + case 'origin-gm.mycht.cn': + $base_url = 'https://gm.mycht.cn'; + break; + case 'origin-cht.mycht.cn': + $base_url = 'https://cht.mycht.cn'; + 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=''; -switch ($_SERVER['SERVER_NAME']){ - case 'origin-ct.mycht.cn': - $base_url='https://ct.mycht.cn'; - break; - case 'origin-gm.mycht.cn': - $base_url='https://gm.mycht.cn'; - break; - case 'origin-cht.mycht.cn': - $base_url='https://cht.mycht.cn'; - break; - case 'origin-int.mycht.cn': - $base_url='https://int.mycht.cn'; - break; - default:$base_url='https://'.$_SERVER['HTTP_HOST']; -} + ?> + + + + + + + - ?> - - - - - - - - + \ No newline at end of file diff --git a/wysiwyg/ckfinder/config.php b/wysiwyg/ckfinder/config.php index d3ca03d6..c7a3f554 100644 --- a/wysiwyg/ckfinder/config.php +++ b/wysiwyg/ckfinder/config.php @@ -108,7 +108,7 @@ switch ($sitecode) { //文件上传目录,使用相对路径,在文件夹中建立虚拟目录指向真实文件夹 //创建指向目录 mklink /D D:\wwwroot\uploader-file\gh\image D:\wwwroot\origin-www.globalhighlights.com\image //需要移出项目文件夹,防止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; } else {