forked from ferchang/reg8log
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_check_block_options.php
More file actions
67 lines (48 loc) · 2.34 KB
/
Copy pathcode_check_block_options.php
File metadata and controls
67 lines (48 loc) · 2.34 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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>");
require_once $index_dir.'include/config/config_brute_force_protection.php';
$block_options=array();
if($identified_user=='Admin') {
if($admin_account_block_threshold==-1 and $admin_ip_block_threshold==-1) return;
$block_options['no_block']=0;
if($admin_account_block_threshold!=-1) {
$block_options['account_block']=2;
$block_options['no_block']+=2;
}
if($admin_ip_block_threshold!=-1) {
$block_options['ip_block']=1;
$block_options['no_block']+=1;
}
if($admin_account_block_threshold!=-1) $block_options['account_block']=$block_options['no_block']-$block_options['account_block'];
if($admin_ip_block_threshold!=-1) $block_options['ip_block']=$block_options['no_block']-$block_options['ip_block'];
if($block_options['no_block']==3) $block_options['account8ip_block']=0;
}
else {
if(!$allow_users2disable_blocks or ($account_block_threshold==-1 and $ip_block_threshold==-1)) return;
$block_options['no_block']=0;
if(($allow_users2disable_blocks==2 or $allow_users2disable_blocks==3) and $account_block_threshold!=-1) {
$block_options['account_block']=2;
$block_options['no_block']=+2;
}
if(($allow_users2disable_blocks==1 or $allow_users2disable_blocks==3) and $ip_block_threshold!=-1) {
$block_options['ip_block']=1;
$block_options['no_block']+=1;
}
if(isset($block_options['account_block'])) $block_options['account_block']=$block_options['no_block']-$block_options['account_block'];
if(isset($block_options['ip_block'])) $block_options['ip_block']=$block_options['no_block']-$block_options['ip_block'];
if($block_options['no_block']==3) $block_options['account8ip_block']=0;
if($account_block_threshold!=-1 and $ip_block_threshold!=-1 and $block_options['no_block']!=3) {
if(isset($block_options['account_block'])) {
$block_options['account8ip_block']=0;
$block_options['ip_block']=$block_options['no_block'];
unset($block_options['account_block'], $block_options['no_block']);
}
else if(isset($block_options['ip_block'])) {
$block_options['account8ip_block']=0;
$block_options['account_block']=$block_options['no_block'];
unset($block_options['ip_block'], $block_options['no_block']);
}
}
}
?>