|
|
|
|
'.__('No Blacklist IPs. You will see blacklisted IP ranges here.', 'loginizer').'
|
';
}else{
foreach($loginizer['blacklist'] as $ik => $iv){
echo '
|
'.$iv['start'].'
|
'.$iv['end'].'
|
'.date('d/m/Y', $iv['time']).'
|
Delete
|
';
}
}
?>
|
|
|
|
'.__('No Whitelist IPs. You will see whitelisted IP ranges here.', 'loginizer').'
|
';
}else{
foreach($loginizer['whitelist'] as $ik => $iv){
echo '
|
'.$iv['start'].'
|
'.$iv['end'].'
|
'.date('d/m/Y', $iv['time']).'
|
Delete
|
';
}
}
?>
inet_ptoi($end_ip)){
// BUT, if 0.0.0.1 - 255.255.255.255 is given, it will not work
if(inet_ptoi($start_ip) >= 0 && inet_ptoi($end_ip) < 0){
// This is right
}else{
$cur_error[] = __('The End IP cannot be smaller than the Start IP', 'loginizer').$line_error;
}
}
if(!empty($cur_error)){
foreach($cur_error as $rk => $rv){
$error[] = $rv;
}
return false;
}
if(!empty($cur_list)){
foreach($cur_list as $k => $v){
// This is to check if there is any other range exists with the same Start or End IP
if(( inet_ptoi($start_ip) <= inet_ptoi($v['start']) && inet_ptoi($v['start']) <= inet_ptoi($end_ip) )
|| ( inet_ptoi($start_ip) <= inet_ptoi($v['end']) && inet_ptoi($v['end']) <= inet_ptoi($end_ip) )
){
$cur_error[] = __('The Start IP or End IP submitted conflicts with an existing IP range !', 'loginizer').$line_error;
break;
}
// This is to check if there is any other range exists with the same Start IP
if(inet_ptoi($v['start']) <= inet_ptoi($start_ip) && inet_ptoi($start_ip) <= inet_ptoi($v['end'])){
$cur_error[] = __('The Start IP is present in an existing range !', 'loginizer').$line_error;
break;
}
// This is to check if there is any other range exists with the same End IP
if(inet_ptoi($v['start']) <= inet_ptoi($end_ip) && inet_ptoi($end_ip) <= inet_ptoi($v['end'])){
$cur_error[] = __('The End IP is present in an existing range!', 'loginizer').$line_error;
break;
}
}
}
if(!empty($cur_error)){
foreach($cur_error as $rk => $rv){
$error[] = $rv;
}
return false;
}
return true;
}