• Hi,

    Thanks for this plugin, works fine. I made small upgrade, because I need to allow lot of IP’s. Now I can use ranges of IP’s. Check this, maybe you can include in next update (your original lines are commented):

    function allow_ip_addresses( $bool ) {
    
    		$ip_addresses = $this->get_allowed_ip_addresses();
    
    		// if ( in_array( $_SERVER['REMOTE_ADDR'], $ip_addresses ) ) {
    			// $bool = false;
    		// }
    
    		// return $bool;
    		foreach ($ip_addresses as $adres) {
    			list($lower, $upper) = explode('-', $adres, 2);
    			$lower_dec = ip2long($lower);
    			if (isset($upper)) {$upper_dec = ip2long($upper);}
    			else { $upper_dec = $lower_dec;}
    			$ip_dec = ip2long($_SERVER['REMOTE_ADDR']);
    			if ($ret=( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) )) {
    				//echo $ret;
    				return false;
    			}
    		}
    		return true;
    	}

    Regards,
    Pawel

    https://ww.wp.xz.cn/plugins/password-protected/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘IP ranges Upgrade’ is closed to new replies.