forked from ferchang/reg8log
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_unblock_ips.php
More file actions
28 lines (22 loc) · 860 Bytes
/
Copy pathcode_unblock_ips.php
File metadata and controls
28 lines (22 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
if(ini_get('register_globals')) exit("<center><h3>Error: Turn that damned register globals off!</h3></center>");
if(!isset($parent_page)) exit("<center><h3>Error: Direct access denied!</h3></center>");
foreach($unblock as $item) {
$query='delete from `ip_incorrect_logins` where ';
$query.=' `admin`='.$reg8log_db->quote_smart($item['admin']);
$query.=' and `ip`='.$reg8log_db->quote_smart($item['ip']);
$query.=' and `timestamp`<='.$reg8log_db->quote_smart($item['last_attempt']);
$reg8log_db->query($query);
}
$autos='';
$i=0;
foreach($unblock as $item) {
if(!is_numeric($item['auto'])) exit('error: auto value not numeric!');
$autos.="{$item['auto']}";
if(++$i==count($unblock)) break;
$autos.=", ";
}
$query='update `ip_block_log` set `unblocked`=1 where `auto` in ('.$autos.")";
$reg8log_db->query($query);
$queries_executed=true;
?>