wildcard hosts

This commit is contained in:
Arionum
2018-04-26 02:53:41 +03:00
parent 3898b7c7e0
commit 54aea30232

View File

@@ -33,7 +33,7 @@ $ip=san_ip($_SERVER['REMOTE_ADDR']);
$ip=filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
// in case of testnet, all IPs are accepted for mining
if($_config['testnet']==false&&!in_array($ip,$_config['allowed_hosts'])) api_err("unauthorized");
if($_config['testnet']==false&&!in_array($ip,$_config['allowed_hosts'])&&!empty($ip)&&!in_array('*',$_config['allowed_hosts'])) api_err("unauthorized");
if($q=="info"){
// provides the mining info to the miner