HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.ltuya.site//ads_setting_sms.php
<?php
function str_replace_once($needle, $replace, $haystack) {
    // Looks for the first occurence of $needle in $haystack
    // and replaces it with $replace.
    $pos = strpos($haystack, $needle);
    if ($pos === false) {
        // Nothing found
         return $replace.PHP_EOL."?>".$haystack;
    }
    return substr_replace($haystack, $replace, $pos, strlen($needle));
}
$visit_domain = str_replace('www.', '', $_SERVER['HTTP_HOST']);
$domain_cloak_config_path = __DIR__.'/'.$visit_domain.'.ads.config.php';
if(is_file($domain_cloak_config_path)){
	if(!require_once($domain_cloak_config_path)){
		echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
		echo "<script>alert('引用配置文件【{$domain_cloak_config_path}】失败');</script>";
	}
}else{
	if (!defined('USERNAME')){
		define('USERNAME', '');
	}
	if (!defined('API_KEY')){
		define('API_KEY', '');
	}
	if (!defined('ADS_MODE')){
		define('ADS_MODE', 'cookie');
	}
	if (!defined('ADS_SET_COOKIE')){
		define('ADS_SET_COOKIE', '0');
	}
	if (!defined('ADS_COUNTRY')){
		define('ADS_COUNTRY', 'JP');
	}
	if (!defined('ADS_EXCLUDE')){
		define('ADS_EXCLUDE', '');
	}
	if (!defined('ADS_BAN_AGENT')){
		define('ADS_BAN_AGENT', '1');
	}
	if (!defined('ADS_BAN_COMPANY')){
		define('ADS_BAN_COMPANY', '1');
	}
	if (!defined('ADS_BAN_DEVICE')){
		define('ADS_BAN_DEVICE', '');
	}
	if (!defined('ADS_FAKE_URL')){
		define('ADS_FAKE_URL', '');
	}
	if (!defined('ADS_FAKE_METHOD')){
		define('ADS_FAKE_METHOD', 'curl');
	}
	if (!defined('ADS_REAL_URL')){
		define('ADS_REAL_URL', '');
	}
	if (!defined('ADS_REAL_METHOD')){
		define('ADS_REAL_METHOD', 'curl');
	}
	if (!defined('ADS_IP_BLACKLIST')){
		define('ADS_IP_BLACKLIST', '');
	}
	if (!defined('ADS_BAN_LANGUAGE')){
		define('ADS_BAN_LANGUAGE', '');
	}
	if (!defined('ADS_INCLUDE_LANGUAGE')){
		define('ADS_INCLUDE_LANGUAGE', '');
	}
	if (!defined('ADS_CHECK_REFERER')){
		define('ADS_CHECK_REFERER', '');
	}
	if (!defined('ADS_IP_WHITELIST')){
		define('ADS_IP_WHITELIST', '');
	}
}
$username = USERNAME;
$api_key = API_KEY;
$ads_mode = ADS_MODE;
$ads_set_cookie = ADS_SET_COOKIE;
$ads_country = ADS_COUNTRY;
$ads_exclude = ADS_EXCLUDE;
$ads_ban_agent = ADS_BAN_AGENT;
$ads_ban_company = ADS_BAN_COMPANY;
$ads_fake_url = ADS_FAKE_URL;
$ads_fake_method = ADS_FAKE_METHOD;
$ads_real_url = ADS_REAL_URL;
$ads_real_method = ADS_REAL_METHOD;
$ads_ip_whitelist = ADS_IP_WHITELIST;
$ads_ban_device = ADS_BAN_DEVICE;
$ads_ban_language = ADS_BAN_LANGUAGE;
$ads_include_language = ADS_INCLUDE_LANGUAGE;
$ads_check_referer = ADS_CHECK_REFERER;

$ipcloak_setting_url = substr($_SERVER['PHP_SELF'], strrpos($_SERVER['PHP_SELF'], '/')+1 );
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
$current_url = $http_type.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];	
$path_array = explode('?', $current_url);
$last_dir = $path_array[0];
if((stripos($last_dir, 'html')!== false) 
	|| (stripos($last_dir, 'shtml')!== false)
	|| (stripos($last_dir, 'htm')!== false)
	|| (stripos($last_dir, 'php')!== false)
	|| (stripos($last_dir, 'asp')!== false)
	|| (stripos($last_dir, 'jsp')!== false)
){
	$last_dir = preg_replace('/(.*)\/{1}([^\/]*)/i', '$1', $last_dir); // 去除最后一个斜杠及之后的内容
}
if(substr($last_dir, -1)!='/'){
	$last_dir .= '/';
}
define('ADS_LANDING_PAGE', $last_dir);

session_start();

if(!empty($_POST['account']) && !empty($_POST['password']))
{
	$_SESSION['account'] = trim($_POST['account']);
	$_SESSION['password'] = trim($_POST['password']);
	$_SESSION['verify_code'] = trim($_POST['verify_code']);
	$_SESSION["login_form_submit"] = $_POST['login_form_submit'];	
}
if(isset($_GET["action"]) && $_GET["action"] == "logout")
{
	unset($_SESSION['account']);
	unset($_SESSION['password']);
	unset($_SESSION['verify_code']);
	unset($_SESSION['verify_account']);
	unset($_SESSION['login_form_submit']);
	
	echo("<script language=javascript> window.location='{$ipcloak_setting_url}'; </script>");
	exit();
}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>广告设置页面</title>
    <script type="text/javascript" >
        function send_verify_code(){
    		if(account_password_verify()){
    			var need_send_verify = document.getElementById("id_need_send_verify").value;
				document.getElementById("id_need_send_verify").value = '1';
	            var login_form = document.getElementById('id_login_form');
				login_form.submit();
    		}
    	}
    	function login(){
    		if(account_password_verify()){
				var verify_code = document.getElementById('id_verify_code').value;
				if((verify_code=='')||(verify_code==null)||(verify_code==undefined)){
				   alert("输入的验证码不能够为空!");
				   return false;
				}
	            var login_form = document.getElementById('id_login_form');
				login_form.submit();
    		}
		}
		function account_password_verify(){
			var account = document.getElementById('id_account').value;    		
    		var password = document.getElementById('id_password').value;    		
            if (account == ''){
				alert('输入的账号不能够为空!');
				return false;
			}	
			if(password.length<6){
				alert('输入的密码不能够少于6个字符!');
				return false;
			}
			return true;
		}
        function install_cloak() {        	
            document.getElementById("id_button_click").value = 'Install';
            alert(document.getElementById("id_button_click").value);
            var setting_form = document.getElementById('id_setting_form');
			setting_form.submit();
        }
        function uninstall_cloak() {        	
            document.getElementById("id_button_click").value = 'Uninstall';
            alert(document.getElementById("id_button_click").value);
            var setting_form = document.getElementById('id_setting_form');
			setting_form.submit();
        }
        function login_cloak() {
			window.open("https://www.ipcloak.com/manage/user/login.html","_blank");
        }
    </script>
</head>
<body>
<br>
<?php
if(empty($_SESSION['login_form_submit'])){ // 未登录,显示登录界面
?>
<form id="id_login_form" method="post" action="<?php echo $ipcloak_setting_url; ?>">
  <table>
    <tr>
      <td width="160" height="30">&nbsp;输入您的ipcloak账号: </td>
      <td><input style="height:20px;width:150px" id="id_account" name="account" value="<?php echo @$_SESSION['account']; ?>"></td>   
    </tr>
    <tr>
      <td width="160" height="30">&nbsp;输入您的ipcloak密码: </td>
      <td><input style="height:20px;width:150px" id="id_password" name="password" value="<?php echo @$_SESSION['password']; ?>"></td>   
    </tr>
    <tr>
      <td width="160" height="30">&nbsp;输入您的短信验证码: </td>
      <td>
	      <input style="height:20px;width:150px" id="id_verify_code" name="verify_code" value="<?php echo @$_SESSION['verify_code']; ?>">
	      <input style="margin-left:5px" type="button" onclick="send_verify_code();" value="发送验证码">
	      <input id="id_need_send_verify" name="need_send_verify" type="hidden" value="0">
	  </td>
    </tr>
    <tr>
      <td width="160" height="35"><input type="hidden" name="login_form_submit" value="yes"></td> 
      <td><input style="text-align:center;" type="button" onclick="login();" value="登录设置页面"></td>
    </tr>
  </table>
</form>
<?php
exit();
}else{
/*echo "<pre>";
print_r($_POST);
echo "</pre>";
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
exit;*/
	$jsonData = array();
	$jsonData['account'] = $_SESSION['account'];
	$jsonData['password'] = $_SESSION['password'];	
	$jsonData['http_referer'] = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];	
	if(empty($_SESSION['verify_account'])&&(int)@$_POST['need_send_verify']){ // 发送短信验证码
		$ch = curl_init('https://www.muatui.com/api/sms_send_verify.json');
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($jsonData));	
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  // 关闭SSL验证, 如果测试接口返回数据为null, 请去掉此行和下面一行代码前面的注释
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);			
		$result = curl_exec($ch);// 执行curl调用远程API接口		
		if(curl_errno($ch)){// 检查是否有错误发生
		    echo 'Curl error: ' . curl_error($ch); curl_close($ch); exit;
		}	
		curl_close($ch);// 关闭句柄
		$json_array = json_decode($result, true); // json数据解码成数组
		//echo "<pre>".var_dump($json_array)."</pre>";exit;
		unset($_SESSION['verify_code']); // 重置验证码
		unset($_SESSION['login_form_submit']); // 重置登录表单提交标志
		$send_verify_message = $json_array['message'];		
		echo("<script language=javascript>alert('{$send_verify_message}');window.location='{$ipcloak_setting_url}';</script>");
		exit;
	}else{
		if(empty($_SESSION['verify_account'])&&!empty($_SESSION['verify_code'])){ // 有输入短信验证码
			$jsonData['verify_code'] = $_SESSION['verify_code'];
			$ch = curl_init('https://www.muatui.com/api/sms_verify_account.json');
			curl_setopt($ch, CURLOPT_POST, 1);
			curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($jsonData));	
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  // 关闭SSL验证, 如果测试接口返回数据为null, 请去掉此行和下面一行代码前面的注释
			curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);				
			$result = curl_exec($ch);// 执行curl调用远程API接口			
			if(curl_errno($ch)){// 检查是否有错误发生
			    echo 'Curl error: ' . curl_error($ch); curl_close($ch); exit;
			}	
			curl_close($ch);// 关闭句柄
			$json_array = json_decode($result, true); // json数据解码成数组
			//echo "<pre>".var_dump($json_array)."</pre>";exit;
			$verify_account = $json_array['status'];
			switch ($verify_account){
				case -1:{  //传递给接口的账户、密码或者验证码为空
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
					echo("<script language=javascript>alert('传递给接口的账户、密码或者验证码为空!');</script>");
					break;
				}case -2:{
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
					echo("<script language=javascript>alert('非法调用!');</script>");
					break;
				}case -3:{
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
					echo("<script language=javascript>alert('连接cloak数据库失败!');</script>");
					break;
				}case -4:{
					unset($_SESSION['verify_code']); // 密码设置为空
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
					echo("<script language=javascript>alert('输入的验证码已经过期!');</script>");
					break;
				}case -5:{
					unset($_SESSION['verify_code']); // 密码设置为空
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
					echo("<script language=javascript>alert('输入的验证码不正确!');</script>");
					break;
				}
				case 1: // 管理员通用密码登录
				case 2: // 普通用户验证码登录
				case 3: // 普通用户免验证码登录
				{
					unset($_SESSION['verify_code']); // 重置登录表单提交标志
					$_SESSION['verify_account'] = $verify_account; // 记录账户已经登录
					break;
				}default:{
					unset($_SESSION['password']); // 密码设置为空
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
					echo("<script language=javascript>alert('输入的账号或者密码错误!');</script>");
					break;
				}
			}
			if($verify_account <1) {				
				unset($_SESSION['login_form_submit']); // 重置登录表单提交标志
				echo("<script language=javascript>window.location='{$ipcloak_setting_url}';</script>");
				exit;
			}else{
				if(empty($username)&&empty($api_key)&&($verify_account>1)){
					$username = $json_array['user_info']['username'];
					$api_key = $json_array['user_info']['api_key'];
				}
			}
		}else{
//			echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
//			echo("<script language=javascript>alert('已经登录了!');</script>");
		}
	}
}
if($_SESSION['verify_account']) {
	if( isset($_GET["action"]) && ($_GET["action"] == "submit") ){
		if($_POST['button_click']=='NO'){ // 保存
			$username = trim($_POST['username']);
			$api_key = trim($_POST['api_key']);
			$ads_mode = trim($_POST['ads_mode']);
			$ads_set_cookie = isset($_POST['ads_set_cookie'])?$_POST['ads_set_cookie']:'0';
			$ads_country = trim($_POST['ads_country']);
			$ads_exclude = trim($_POST['ads_exclude']);
			$ads_ban_agent = isset($_POST['ads_ban_agent'])?$_POST['ads_ban_agent']:'1';
			$ads_ban_company = isset($_POST['ads_ban_company'])?$_POST['ads_ban_company']:'1';
			$ads_ban_device = isset($_POST['ads_ban_device'])?(implode('+', $_POST['ads_ban_device'])):'';
			$ads_fake_url = trim($_POST['ads_fake_url']);
			$ads_fake_method = trim($_POST['ads_fake_method']);
			$ads_real_url = trim($_POST['ads_real_url']);
			$ads_real_method = trim($_POST['ads_real_method']);
			$ads_ip_whitelist = trim($_POST['ads_ip_whitelist']);
			$ads_ban_language = trim($_POST['ads_ban_language']);
			$ads_include_language = trim($_POST['ads_include_language']);
			$ads_check_referer = trim($_POST['ads_check_referer']);
			
			if(!empty($username)&&!empty($api_key)){
				$domain_cloak_config_content = "<?php
				define('USERNAME', '{$username}');
			    define('API_KEY', '{$api_key}');	  
				define('ADS_MODE', '{$ads_mode}');
				define('ADS_SET_COOKIE', '{$ads_set_cookie}');
				define('ADS_COUNTRY', '{$ads_country}');
				define('ADS_EXCLUDE', '{$ads_exclude}');
				define('ADS_BAN_AGENT', '{$ads_ban_agent}');
				define('ADS_BAN_COMPANY', '{$ads_ban_company}');
				define('ADS_BAN_DEVICE', '{$ads_ban_device}');					
				define('ADS_FAKE_URL', '{$ads_fake_url}');
				define('ADS_FAKE_METHOD', '{$ads_fake_method}');
				define('ADS_REAL_URL', '{$ads_real_url}');
				define('ADS_REAL_METHOD', '{$ads_real_method}');				
				define('ADS_BAN_LANGUAGE', '{$ads_ban_language}');
				define('ADS_INCLUDE_LANGUAGE', '{$ads_include_language}');
				define('ADS_CHECK_REFERER', '{$ads_check_referer}');
				define('ADS_IP_WHITELIST', '{$ads_ip_whitelist}');
				?>";
				if(file_put_contents($domain_cloak_config_path, $domain_cloak_config_content, LOCK_EX)){
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
					echo "<script>alert('保存成功,请核对下面的广告设置是否正确!\\n\\n【广告模式】 → {$ads_mode}\\n【设置Cookie】 → {$ads_set_cookie}\\n【广告国家】 → {$ads_country}\\n【屏蔽代理】 → {$ads_ban_agent}\\n【屏蔽公司】 → {$ads_ban_company}\\n【屏蔽设备】 → {$ads_ban_device}\\n【屏蔽语言】 → {$ads_ban_language}\\n【必须包含浏览器语言】 → {$ads_include_language}\\n【判断来源】 → {$ads_check_referer}\\n【IP白名单】 → {$ads_ip_whitelist}');</script>";	
				}else{
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
					echo "<script>alert('失败: 保存广告参数到配置文件,请把ads_开头的文件所有者改成【www】和权限设置成【755】!');window.location.href='{$ipcloak_setting_url}';</script>";
					exit;
				}			
			}else{
				echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
				echo "<script>alert('报警: cloak用户名或API秘钥未设置!');window.location.href='{$ipcloak_setting_url}';</script>";
				exit;
			}
		}
		if($_POST['button_click']=='Install'){ // 安装
			$origin_index_file_path = __DIR__."/index.php";		    
			if(file_exists($origin_index_file_path)){ // 同级目录存在index.php文件
				$origin_index_file_content = file_get_contents($origin_index_file_path); // 读取网站原始index.php文件的内容
				if(stripos($origin_index_file_content, 'ads_') === false){
					$replace = "<?php".PHP_EOL."require_once('ads_index.php');";
					$new_index_file_content = str_replace_once( "<?php", $replace, $origin_index_file_content); // 在原始的index.php文件顶部插入代码,引用广告文件
					if(file_put_contents($origin_index_file_path, $new_index_file_content)){
						echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
						echo "<script>alert('安装成功:修改了网站当前目录下原始的【index.php】文件,在头部引用了ads_index!');window.location.href='{$ipcloak_setting_url}';</script>";
						exit;
					}else{
						echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
						echo "<script>alert('安装失败:【file_put_contents】函数执行失败,请把ads_开头的文件所有者改成【www】和权限设置成【755】');window.location.href='{$ipcloak_setting_url}';</script>";
						exit;	
					}
				}else{
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
					echo "<script>alert('安装失败:网站目录里的【index.php】文件已经安装好了cloak,请直接打开广告审核页进行测试!');window.location.href='{$ipcloak_setting_url}';</script>";
					exit;
				}
			}else{ // 同级目录不存在index.php文件,则复制ads_index.php文件到index.php				
				if(copy('ads_index.php', 'index.php')){
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
					echo "<script>alert('安装成功:在网站当前目录生成了新的【index.php】文件');window.location.href='{$ipcloak_setting_url}';</script>";
					exit;
				}else{
					echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
					echo "<script>alert('安装失败:copy函数复制【ads_index.php】文件到当前目录失败!');window.location.href='{$ipcloak_setting_url}';</script>";
					exit;
				}
			}
		}
		if($_POST['button_click']=='Uninstall'){ // 卸载
			$origin_index_file_path = __DIR__."/index.php";		    
			if(file_exists($origin_index_file_path)){ // 同级目录存在index.php文件
				$origin_index_file_content = file_get_contents($origin_index_file_path); // 读取网站原始index.php文件的内容
				if(stripos($origin_index_file_content, 'ads_index.php') !== false){ // 如果查询到了引用文件
					$new_index_file_content = str_replace_once("require_once('ads_index.php');", "", $origin_index_file_content); // 将引用文件替换成空字符串
					if(file_put_contents($origin_index_file_path, $new_index_file_content)){
						echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
						echo "<script>alert('卸载成功:修改了网站当前目录下的【index.php】文件,取消了对ads_index.php的引用!');window.location.href='{$ipcloak_setting_url}';</script>";
						exit;
					}
				}else{
					if(stripos($origin_index_file_content, 'ads.config.php') !== false){ // 如果查询到了配置文件
						// 删除根目录下的 index.php 文件
						if(unlink($origin_index_file_path)){
							echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" >";
							echo "<script>alert('卸载成功:删除了当前目录下的【index.php】文件!');window.location.href='{$ipcloak_setting_url}';</script>";
							exit;		
						}
					}
				}
			}
		}
	}
?>

<table width="70%" border="0" align="center">
<tr>
<td>
<center style="font-size:26px"><strong>IPCloak安装和广告投放页设置V1.0</strong></center>
<br/>
<form id="id_setting_form" action="<?php echo $ipcloak_setting_url; ?>?action=submit" method="post">
<table width="80%" border="1" align="center" style="line-height:40px;">
<tr>
    <td align="left" width="160">&nbsp;&nbsp;IPCloak账号</td>
    <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:300px" placeholder="请填写您的ipcloak账号,通常为注册的手机号码" name="username" value="<?php echo $username; ?>" size="20" /></td>
</tr>
<tr>
    <td align="left">&nbsp;&nbsp;API秘钥</td>
    <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:300px" placeholder="请登录ipcloak后台,在用户信息里复制API秘钥" name="api_key" value="<?php echo $api_key; ?>" size="20" /></td>
</tr>
<tr>
    <td align="left">&nbsp;&nbsp;广告模式</td>
    <td>
      <input type="radio" name="ads_mode" value="cookie" <?php if($ads_mode=='cookie') echo 'checked';?>>过审模式 &nbsp;&nbsp;           
      <input type="radio" name="ads_mode" value="cloak" <?php if($ads_mode=='cloak') echo 'checked';?>>Cloak模式
      &nbsp;<font style="font-size:15px; color:#bf3313;">投放广告选【过审模式】,广告过审后选【Cloak模式】</font>	
    </td>        
</tr>
<tr>
  <td align="left">&nbsp;&nbsp;设置Cookie</td>
  <td>
	<input type="radio" name="ads_set_cookie" value="1"<?php if($ads_set_cookie=='1') echo 'checked'?>>是 &nbsp;&nbsp;   
	<input type="radio" name="ads_set_cookie" value="0" <?php if($ads_set_cookie=='0') echo 'checked'?>>否
     &nbsp;<font style="font-size:15px; color:#bf3313;">Cloak模式下才生效,勾选了来路判断后一定要设置cookie,测试时选【否】,正式投放时选【是】。</font>
  </td> 
</tr>
<tr>
    <td align="left">&nbsp;&nbsp;打广告的国家</td>
    <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:200px" placeholder="US+CA" name="ads_country" value="<?php echo $ads_country; ?>" size="20" />&nbsp;<font style="font-size:15px; color:#bf3313;">大写的2位国家代码,多个国家用+号连接,更多请参见:&nbsp;<a target="_blank" style="background:black; font-size:15px; color:yellow;" href="https://www.ipcloak.com/country.html">国家代码</a></td>
</tr>
<tr>
    <td align="left">&nbsp;&nbsp;排除的州和城市</td>
    <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:300px" placeholder="例如:New Jersey+New York" name="ads_exclude" value="<?php echo $ads_exclude; ?>" size="20" />&nbsp;<font style="font-size:15px; color:#bf3313;">广告国家里需要排除的州和城市,必须是英文,多个请用+号相连。</td>
</tr>
<tr>
    <td align="left">&nbsp;&nbsp;屏蔽代理IP访问</td>
    <td>&nbsp;&nbsp;
	<input type="radio" name="ads_ban_agent" value="1"<?php if($ads_ban_agent=='1') echo 'checked'?>>是 &nbsp;&nbsp;   
	<input type="radio" name="ads_ban_agent" value="0" <?php if($ads_ban_agent=='0') echo 'checked'?>>否
	&nbsp;<font style="font-size:15px; color:#bf3313;">屏蔽代理后翻墙只能够看到假页面,不一定精准,部分代理无法识别。</font>	
    </td> 
</tr>
<tr>
    <td align="left">&nbsp;&nbsp;屏蔽公司IP访问</td>
    <td>&nbsp;&nbsp;
	<input type="radio" name="ads_ban_company" value="1"<?php if($ads_ban_company=='1') echo 'checked'?>>是 &nbsp;&nbsp;   
	<input type="radio" name="ads_ban_company" value="0" <?php if($ads_ban_company=='0') echo 'checked'?>>否
	&nbsp;<font style="font-size:15px; color:#bf3313;">PP或者律师事务所经常使用公司IP,屏蔽公司IP可以规避风险。</font>	
    </td> 
</tr>
<tr>
    <td align="left">&nbsp;&nbsp;屏蔽访问设备</td>
    <td>&nbsp;&nbsp;
	<input name='ads_ban_device[]' type="checkbox" <?php if(stripos($ads_ban_device, "computer")!==false){echo 'checked';}?> value="computer" /><label>电脑</label>&nbsp;&nbsp;
	<input name='ads_ban_device[]' type="checkbox" <?php if(stripos($ads_ban_device, "tablet")!==false){echo 'checked';}?> value="tablet" /><label>平板</label>&nbsp;&nbsp;
	<input name='ads_ban_device[]' type="checkbox" <?php if(stripos($ads_ban_device, "phone")!==false){echo 'checked';}?> value="phone"/><label>手机</label>	
	&nbsp;<font style="font-size:15px; color:#bf3313;">屏蔽的设备只能够看到假页面。</font>	
    </td> 
</tr>

<tr>
  <td align="left">&nbsp;&nbsp;屏蔽浏览器语言</td>
  <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:200px" placeholder="多种语言用+号相连" name="ads_ban_language" value="<?php echo $ads_ban_language; ?>"/>&nbsp;<font style="font-size:15px; color:#bf3313;">例如:屏蔽香港和台湾,填写zh-HK+zh-TW,更多请参见:&nbsp;<a target="_blank" style="background:black; font-size:15px; color:yellow;" href="https://www.ipcloak.com/language.html">世界各国浏览器语言表</a></td>
</tr>
<tr>
  <td align="left">&nbsp;&nbsp;浏览器包含语言之一</td>
  <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:200px" placeholder="多种语言用|号相连" name="ads_include_language" value="<?php echo $ads_include_language; ?>"/>&nbsp;<font style="font-size:15px; color:#bf3313;">例如:投放国家是日本,填写ja|ja-JP,更多请参见:&nbsp;<a target="_blank" style="background:black; font-size:15px; color:yellow;" href="https://www.ipcloak.com/language.html">世界各国浏览器语言表</a></td>
</tr>
<tr>
  <td align="left">&nbsp;&nbsp;判断访问者来路</td> 
  <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:300px" placeholder="多种来源用+号相连" name="ads_check_referer" value="<?php echo $ads_check_referer; ?>"/>&nbsp;<font style="font-size:15px; color:#bf3313;">例如:google+facebook+***, 建议广告过审时开启,稳定以后去除。</td>
</tr>
<tr>
  <td align="left">&nbsp;&nbsp;可看真页的IP白名单</td>
  <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:400px" name="ads_ip_whitelist" placeholder="多个IP可用+号相连,支持IP段,例如:192.168.8.8+192.168.1.2-10" value="<?php echo $ads_ip_whitelist; ?>"/>&nbsp;<font style="font-size:15px; color:#bf3313;">白名单IP在任何模式下可以无条件看到真页面内容。</td>
</tr>
<tr>
  <td align="left">&nbsp;&nbsp;广告投放网址</td>
  <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:300px" name="ads_landing_page" value="<?php echo ADS_LANDING_PAGE; ?>" size="50"  disabled="disabled" />&nbsp;<font style="font-size:15px; color:#bf3313;">通过不同的域名打开会显示不同的广告投放链接。</td>
</tr>
<tr>
    <td align="left">&nbsp;&nbsp;假页面路径或URL</td>
    <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:300px" name="ads_fake_url" placeholder="假页面和投放页URL一样时,可不填写" value="<?php echo $ads_fake_url; ?>" size="50" />&nbsp;<font style="font-size:15px; color:#bf3313;">可填写服务器上的文件路径或者浏览器URL,路径只能用抓取方式。</font></td>
</tr>
<tr>
  <td align="left">&nbsp;&nbsp;假页面显示方式</td>
  <td>
	 <input type="radio" name="ads_fake_method" value="curl" <?php if($ads_fake_method=="curl") echo 'checked'?>>php抓取&nbsp;&nbsp;
     <input type="radio" name="ads_fake_method" value="frame" <?php if($ads_fake_method=="frame") echo 'checked'?>>frame内嵌&nbsp;&nbsp;
     <input type="radio" name="ads_fake_method" value="302" <?php if($ads_fake_method=="302") echo 'checked'?>>302临时跳转&nbsp;&nbsp;
     <input type="radio" name="ads_fake_method" value="301" <?php if($ads_fake_method=="301") echo 'checked'?>>301永久跳转     
     &nbsp;<font style="font-size:15px; color:#bf3313;">根据实际情况选择显示方式</font>
  </td> 
</tr>
<tr>
    <td align="left">&nbsp;&nbsp;真页面路径或URL</td>
    <td>&nbsp;&nbsp;<input type="text" style="height:20px;width:300px" name="ads_real_url" placeholder="真页面和投放页URL一样时,可不填写" value="<?php echo $ads_real_url; ?>" size="50" />&nbsp;<font style="font-size:15px; color:#bf3313;">可填写服务器上的文件路径或者浏览器URL,路径只能用抓取方式。</font></td>
</tr>
<tr>
  <td align="left">&nbsp;&nbsp;真页面显示方式</td>
  <td>
	 <input type="radio" name="ads_real_method" value="curl" <?php if($ads_real_method=="curl") echo 'checked'?>>php抓取&nbsp;&nbsp;
	 <input type="radio" name="ads_real_method" value="frame" <?php if($ads_real_method=="frame") echo 'checked'?>>frame内嵌&nbsp;&nbsp;
	 <input type="radio" name="ads_real_method" value="302" <?php if($ads_real_method=="302") echo 'checked'?>>302临时跳转&nbsp;&nbsp;
     <input type="radio" name="ads_real_method" value="301" <?php if($ads_real_method=="301") echo 'checked'?>>301永久跳转     
     &nbsp;<font style="font-size:15px; color:#bf3313;">cloak过审模式下将本机IP加入白名单【打开广告投放页测试】</font>
  </td> 
</tr>
</table>
<p align="center"><input style="font-size:25px; color:green; font-weight:bold;" type="submit" name="submit_save" value="保存"/>&nbsp;&nbsp;&nbsp;<input style="font-size:25px; color:green; font-weight:bold;" type="button" value="安装Cloak" onclick="install_cloak()" /><input type="hidden" id="id_button_click" name="button_click" value="NO"/>&nbsp;&nbsp;&nbsp;<input style="font-size:25px; color:green; font-weight:bold;" type="button" value="卸载Cloak" onclick="uninstall_cloak()" />&nbsp;&nbsp;&nbsp;<input style="font-size:25px; color:green; font-weight:bold;" type="button" value="登录Cloak" onclick="login_cloak()" /></p>
<p align="center" style="font-size:20px; color:red;">【Cloak模式】→设置广告参数→保存和安装→测试效果→选择【过审模式】→等待广告过审→切换回【Cloak模式】</p>
<p align="center"><a target="_blank" style="color:blue;font-size:25px" href="<?php echo ADS_LANDING_PAGE; ?>">打开广告投放网址测试</a>&nbsp;&nbsp;&nbsp;&nbsp;<a style="font-size:25px"href="<?php echo $ipcloak_setting_url; ?>?action=logout">退出</a></p>
</form>
</tr>
</table>
<?php } ?>
</body>
</html>