Subversion Repositories ALCASAR

Rev

Rev 870 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 870 Rev 879
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
<HTML><!-- written by Rexy -->
2
<HTML><!-- written by Rexy -->
3
<HEAD>
3
<HEAD>
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
<TITLE>Network Filter</TITLE>
5
<TITLE>Network Filter</TITLE>
6
<link rel="stylesheet" href="/css/style.css" type="text/css">
6
<link rel="stylesheet" href="/css/style.css" type="text/css">
7
</HEAD>
7
</HEAD>
8
<body>
8
<body>
9
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
9
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
10
<?
10
<?
11
# Choice of language
11
# Choice of language
12
$Language = 'en';
12
$Language = 'en';
13
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
13
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
14
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
14
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
15
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
15
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
16
if($Language == 'fr'){
16
if($Language == 'fr'){
17
  $l_title_antivir = "Antivirus de flux WEB";
17
  $l_title_antivir = "Antivirus de flux WEB";
18
  $l_antivir_on="L'antivirus de flux WEB est actuellement activ&eacute;";
18
  $l_antivir_on="L'antivirus de flux WEB est actuellement activ&eacute;";
19
  $l_antivir_off="L'antivirus de flux WEB est actuellement désactiv&eacute;";
19
  $l_antivir_off="L'antivirus de flux WEB est actuellement désactiv&eacute;";
20
  $l_switch_antivir_on="Activer l'antivirus";
20
  $l_switch_antivir_on="Activer l'antivirus";
21
  $l_switch_antivir_off="D&eacute;sactiver l'antivirus";
21
  $l_switch_antivir_off="D&eacute;sactiver l'antivirus";
22
  $l_title_ip_block="Filtrage d'adresses IP";
22
  $l_title_ip_block="Filtrage d'adresses IP";
23
  $l_ip_address="Adresses IP (ou addresse de réseau) bloquées";
23
  $l_ip_address="Adresses IP (ou addresse de réseau) bloquées";
24
  $l_blocked_ip_address="Adresses IP";
24
  $l_blocked_ip_address="Adresses IP";
25
  $l_blocked_ip_address_comment="Commentaires";
25
  $l_blocked_ip_address_comment="Commentaires";
26
  $l_blocked="Bloquée";
26
  $l_blocked="Bloquée";
27
  $l_ip_block_explain="Liste des adresses IP (ou adresses IP de réseaux) bloquées";
27
  $l_ip_block_explain="Liste des adresses IP (ou adresses IP de réseaux) bloquées";
28
  $l_remove="Retirer de la liste";
28
  $l_remove="Retirer de la liste";
29
  $l_title_proto = "Filtrage de protocoles r&eacute;seau";
29
  $l_title_proto = "Filtrage de protocoles r&eacute;seau";
30
  $l_netfilter_on="Le filtrage de protocoles r&eacute;seau est actuellement activ&eacute;";
30
  $l_netfilter_on="Le filtrage de protocoles r&eacute;seau est actuellement activ&eacute;";
31
  $l_netfilter_off="Le filtrage de protocoles réseau est actuellement désactiv&eacute";
31
  $l_netfilter_off="Le filtrage de protocoles réseau est actuellement désactiv&eacute";
32
  $l_switch_on="Activer le filtrage";
32
  $l_switch_on="Activer le filtrage";
33
  $l_switch_off="D&eacute;sactiver le filtrage";
33
  $l_switch_off="D&eacute;sactiver le filtrage";
34
  $l_comment_on="&Agrave; l'exclusion du WEB (port 80), les protocoles r&eacute;seau sont interdits.<BR>Choisissez ci-dessous les protocoles que vous autorisez";
34
  $l_comment_on="&Agrave; l'exclusion du WEB (port 80), les protocoles r&eacute;seau sont interdits.<BR>Choisissez ci-dessous les protocoles que vous autorisez";
35
  $l_comment_off="(tous les protocoles réseau sont autoris&eacute;s)";
35
  $l_comment_off="(tous les protocoles réseau sont autoris&eacute;s)";
36
  $l_protocols="Protocoles autoris&eacute;s";
36
  $l_protocols="Protocoles autoris&eacute;s";
37
  $l_error_open_file="Erreur d'ouverture du fichier";
37
  $l_error_open_file="Erreur d'ouverture du fichier";
38
  $l_port="Numéro de port";
38
  $l_port="Numéro de port";
39
  $l_proto="Nom du protocole";
39
  $l_proto="Nom du protocole";
40
  $l_enabled="Autoris&eacute;";
40
  $l_enabled="Autoris&eacute;";
41
  $l_add_to_list="Ajouter &agrave; la liste";
41
  $l_add_to_list="Ajouter &agrave; la liste";
42
  $l_save="Enregistrer les modifications";
42
  $l_save="Enregistrer les modifications";
43
}
43
}
44
else {
44
else {
45
  $l_title_antivir = "WEB antivirus";
45
  $l_title_antivir = "WEB antivirus";
46
  $l_antivir_on="Actually, the WEB antivirus is on";
46
  $l_antivir_on="Actually, the WEB antivirus is on";
47
  $l_antivir_off="Actually, the WEB antivirus is off";
47
  $l_antivir_off="Actually, the WEB antivirus is off";
48
  $l_switch_antivir_on="Switch the antivirus on";
48
  $l_switch_antivir_on="Switch the antivirus on";
49
  $l_switch_antivir_off="Switch the antivirus off";
49
  $l_switch_antivir_off="Switch the antivirus off";
50
  $l_title_ip_block="IP address filter";
50
  $l_title_ip_block="IP address filter";
51
  $l_ip_address="IP address (or network IP address)";
51
  $l_ip_address="IP address (or network IP address)";
52
  $l_blocked_ip_address="IP addresses";
52
  $l_blocked_ip_address="IP addresses";
53
  $l_blocked_ip_address_comment="Comments";
53
  $l_blocked_ip_address_comment="Comments";
54
  $l_blocked="Blocked";
54
  $l_blocked="Blocked";
55
  $l_ip_block_explain="List of blocked IP addresses (or network IP adresses)";
55
  $l_ip_block_explain="List of blocked IP addresses (or network IP adresses)";
56
  $l_remove="Remove from list";
56
  $l_remove="Remove from list";
57
  $l_title_proto = "Network protocols filter";
57
  $l_title_proto = "Network protocols filter";
58
  $l_netfilter_on="Actually, the network protocols filter is enable";
58
  $l_netfilter_on="Actually, the network protocols filter is enable";
59
  $l_netfilter_off="Actually, the network protocols filter is disable";
59
  $l_netfilter_off="Actually, the network protocols filter is disable";
60
  $l_switch_on="Switch the Filter on";
60
  $l_switch_on="Switch the Filter on";
61
  $l_switch_off="Switch the Filter off";
61
  $l_switch_off="Switch the Filter off";
62
  $l_comment_on="(choose the authorized network protocols)";
62
  $l_comment_on="(choose the authorized network protocols)";
63
  $l_comment_on="Except for the WEB (port 80), all protocols are blocked.<BR>Choose in the list below, the protocols you want authorize";
63
  $l_comment_on="Except for the WEB (port 80), all protocols are blocked.<BR>Choose in the list below, the protocols you want authorize";
64
  $l_comment_off="(all the network protocols are allowed for authenticated users)";
64
  $l_comment_off="(all the network protocols are allowed for authenticated users)";
65
  $l_protocols="Authorize protocols";
65
  $l_protocols="Authorize protocols";
66
  $l_error_open_file="Error opening the file";
66
  $l_error_open_file="Error opening the file";
67
  $l_port="Port number";
67
  $l_port="Port number";
68
  $l_proto="protocol name";
68
  $l_proto="protocol name";
69
  $l_enabled="Authorized";
69
  $l_enabled="Authorized";
70
  $l_add_to_list="Add to the list";
70
  $l_add_to_list="Add to the list";
71
  $l_save="Save changes";
71
  $l_save="Save changes";
72
}
72
}
73
/********************
73
/********************
74
*  TEST CONF FILES  *
74
*  TEST CONF FILES  *
75
*********************/
75
*********************/
76
define ("SERVICES_LIST", "/usr/local/etc/alcasar-services");
76
define ("SERVICES_LIST", "/usr/local/etc/alcasar-services");
77
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
77
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
78
define ("IP_BLOCKED", "/usr/local/etc/alcasar-ip-blocked");
78
define ("IP_BLOCKED", "/usr/local/etc/alcasar-ip-blocked");
79
$conf_files=array(SERVICES_LIST,CONF_FILE,IP_BLOCKED);
79
$conf_files=array(SERVICES_LIST,CONF_FILE,IP_BLOCKED);
80
foreach ($conf_files as $file){
80
foreach ($conf_files as $file){
81
if (!file_exists($file)){
81
if (!file_exists($file)){
82
	exit("Requested file ".$file." isn't present");}
82
	exit("Requested file ".$file." isn't present");}
83
if (!is_readable($file)){
83
if (!is_readable($file)){
84
	exit("Can't read the file ".$file);}
84
	exit("Can't read the file ".$file);}
85
}
85
}
86
/**********************************
86
/**********************************
87
*	Read ALCASAR CONF_FILE    *
87
*	Read ALCASAR CONF_FILE    *
88
***********************************/
88
***********************************/
89
$ouvre=fopen(CONF_FILE,"r");
89
$ouvre=fopen(CONF_FILE,"r");
90
if ($ouvre){
90
if ($ouvre){
91
	while (!feof ($ouvre))
91
	while (!feof ($ouvre))
92
	{
92
	{
93
		$tampon = fgets($ouvre, 4096);
93
		$tampon = fgets($ouvre, 4096);
94
		if (strpos($tampon,"=")!==false){
94
		if (strpos($tampon,"=")!==false){
95
			$tmp = explode("=",$tampon);
95
			$tmp = explode("=",$tampon);
96
			$conf[$tmp[0]] = $tmp[1];
96
			$conf[$tmp[0]] = $tmp[1];
97
		}
97
		}
98
	}
98
	}
99
}else{
99
	fclose($ouvre);
100
	exit("Erreur d'ouverture du fichier ".CONF_FILE);
-
 
101
}
100
}
102
fclose($ouvre);
-
 
103
 
101
 
104
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
102
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
105
switch ($choix)
103
switch ($choix)
106
{
104
{
107
case 'AV_On' :
105
case 'AV_On' :
108
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -on");
106
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -on");
109
	break;
107
	break;
110
case 'AV_Off' :
108
case 'AV_Off' :
111
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -off");
109
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -off");
112
	break;
110
	break;
113
case 'NF_On' :
111
case 'NF_On' :
114
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
112
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
115
	break;
113
	break;
116
case 'NF_Off' :
114
case 'NF_Off' :
117
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -off");
115
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -off");
118
	break;
116
	break;
119
case 'new_port' :
117
case 'new_port' :
120
	if ((trim($_POST['add_port']) != "80") and ($_POST['add_port'] != "") and ($_POST['add_proto'] != "") and (is_numeric($_POST['add_port'])))
118
	if ((trim($_POST['add_port']) != "80") and ($_POST['add_port'] != "") and ($_POST['add_proto'] != "") and (is_numeric($_POST['add_port'])))
121
		{
119
		{
122
		$_POST['add_proto'] = str_replace (CHR(32),"-",$_POST['add_proto']);
120
		$_POST['add_proto'] = str_replace (CHR(32),"-",$_POST['add_proto']);
123
		$tab=file(SERVICES_LIST);
121
		$tab=file(SERVICES_LIST);
124
		$insert = true;
122
		$insert = true;
125
		if ($tab) // file isn't empty
123
		if ($tab) // file isn't empty
126
			{
124
			{
127
			foreach ($tab as $line)  //test if port doesn't already exist
125
			foreach ($tab as $line)  //test if port doesn't already exist
128
				{
126
				{
129
				$proto_f=explode(" ", $line);
127
				$proto_f=explode(" ", $line);
130
				if (trim($_POST['add_port']) == trim($proto_f[1])) {$insert = false;}
128
				if (trim($_POST['add_port']) == trim($proto_f[1])) {$insert = false;}
131
				}
129
				}
132
			}
130
			}
133
		if ($insert == true) 
131
		if ($insert == true) 
134
			{
132
			{
135
			$line = "\n" . "#" . trim($_POST['add_proto']) . " " . trim($_POST['add_port']);
133
			$line = "\n" . "#" . trim($_POST['add_proto']) . " " . trim($_POST['add_port']);
136
			$pointeur=fopen(SERVICES_LIST,"a");
134
			$pointeur=fopen(SERVICES_LIST,"a");
137
			fwrite ($pointeur, $line);
135
			fwrite ($pointeur, $line);
138
			fclose ($pointeur);
136
			fclose ($pointeur);
139
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
137
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
140
			}
138
			}
141
		}
139
		}
142
	break;
140
	break;
143
case 'new_ip' :
141
case 'new_ip' :
144
	if (trim($_POST['add_ip']) != "") 
142
	if (trim($_POST['add_ip']) != "") 
145
		{
143
		{
146
		$_POST['add_comment'] = str_replace (CHR(32),"-",$_POST['add_comment']);
144
		$_POST['add_comment'] = str_replace (CHR(32),"-",$_POST['add_comment']);
147
		$tab=file(IP_BLOCKED);
145
		$tab=file(IP_BLOCKED);
148
		$insert = true;
146
		$insert = true;
149
		if ($tab) // file isn't empty
147
		if ($tab) // file isn't empty
150
			{
148
			{
151
			foreach ($tab as $line) // test if IP address doesn't already exist
149
			foreach ($tab as $line) // test if IP address doesn't already exist
152
				{
150
				{
153
				$IP_f=explode(" ", $line);
151
				$IP_f=explode(" ", $line);
154
				if (strcmp (trim($_POST['add_ip']),trim(trim($IP_f[0],"#"))) == 0)
152
				if (strcmp (trim($_POST['add_ip']),trim(trim($IP_f[0],"#"))) == 0)
155
					{
153
					{
156
					$insert = false;
154
					$insert = false;
157
					break;
155
					break;
158
					}
156
					}
159
				}
157
				}
160
			}
158
			}
161
		if ($insert == true) 
159
		if ($insert == true) 
162
			{
160
			{
163
			$line ="\n" . "#".trim($_POST['add_ip']) . " " . trim($_POST['add_comment']);
161
			$line ="\n" . "#".trim($_POST['add_ip']) . " " . trim($_POST['add_comment']);
164
			$pointeur=fopen(IP_BLOCKED,"a");
162
			$pointeur=fopen(IP_BLOCKED,"a");
165
			fwrite ($pointeur, $line);
163
			fwrite ($pointeur, $line);
166
			fclose ($pointeur);
164
			fclose ($pointeur);
167
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
165
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
168
			}
166
			}
169
		}
167
		}
170
	break;
168
	break;
171
case 'change_port' :
169
case 'change_port' :
172
	$tab=file(SERVICES_LIST);
170
	$tab=file(SERVICES_LIST);
173
	if ($tab)
171
	if ($tab)
174
		{
172
		{
175
// authorize/block protocols
173
// authorize/block protocols
176
		$pointeur=fopen(SERVICES_LIST,"w+");
174
		$pointeur=fopen(SERVICES_LIST,"w+");
177
		foreach ($tab as $ligne)
175
		foreach ($tab as $ligne)
178
			{
176
			{
179
			$proto_f=explode(" ", $ligne);
177
			$proto_f=explode(" ", $ligne);
180
			$name_svc1=trim($proto_f[0],"#");
178
			$name_svc1=trim($proto_f[0],"#");
181
			$actif = False; $remove_line = false;
179
			$actif = False; $remove_line = false;
182
			foreach ($_POST as $key => $value)
180
			foreach ($_POST as $key => $value)
183
				{
181
				{
184
				if (strstr($key,'del-'))
182
				if (strstr($key,'del-'))
185
					{
183
					{
186
					$name_svc2 = str_replace('del-','',$key);
184
					$name_svc2 = str_replace('del-','',$key);
187
					if ($name_svc1 == $name_svc2)
185
					if ($name_svc1 == $name_svc2)
188
				       		{
186
				       		{
189
						$remove_line = True;
187
						$remove_line = True;
190
						}
188
						}
191
					}
189
					}
192
				if (strstr($key,'chk-'))
190
				if (strstr($key,'chk-'))
193
					{
191
					{
194
					$name_svc2 = str_replace('chk-','',$key);
192
					$name_svc2 = str_replace('chk-','',$key);
195
					if ($name_svc1 == $name_svc2)
193
					if ($name_svc1 == $name_svc2)
196
				       		{
194
				       		{
197
						$actif = True;
195
						$actif = True;
198
						break;
196
						break;
199
						}
197
						}
200
					}
198
					}
201
				}
199
				}
202
			if (! $remove_line)
200
			if (! $remove_line)
203
				{
201
				{
204
				if (! $actif) {	$line="#$name_svc1 $proto_f[1]";}
202
				if (! $actif) {	$line="#$name_svc1 $proto_f[1]";}
205
				else { $line="$name_svc1 $proto_f[1]";}
203
				else { $line="$name_svc1 $proto_f[1]";}
206
				fwrite($pointeur,$line);
204
				fwrite($pointeur,$line);
207
				}
205
				}
208
			}
206
			}
209
		fclose($pointeur);
207
		fclose($pointeur);
210
		}
208
		}
211
	exec ("sudo /usr/local/bin/alcasar-iptables.sh -on");
209
	exec ("sudo /usr/local/bin/alcasar-iptables.sh -on");
212
	break;
210
	break;
213
case 'change_ip' :
211
case 'change_ip' :
214
	$tab=file(IP_BLOCKED);
212
	$tab=file(IP_BLOCKED);
215
	if ($tab)
213
	if ($tab)
216
		{
214
		{
217
// authorize/block IPs 
215
// authorize/block IPs 
218
		$pointeur=fopen(IP_BLOCKED,"w+");
216
		$pointeur=fopen(IP_BLOCKED,"w+");
219
		foreach ($tab as $ligne)
217
		foreach ($tab as $ligne)
220
			{
218
			{
221
			$ip_f=explode(" ", $ligne);
219
			$ip_f=explode(" ", $ligne);
222
			$ip_blocked1=trim($ip_f[0],"#");
220
			$ip_blocked1=trim($ip_f[0],"#");
223
			$actif = False; $remove_line = false;
221
			$actif = False; $remove_line = false;
224
			foreach ($_POST as $key => $value)
222
			foreach ($_POST as $key => $value)
225
				{
223
				{
226
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
224
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
227
				if (strstr($key,'del-'))
225
				if (strstr($key,'del-'))
228
					{
226
					{
229
					$ip_blocked2 = str_replace('del-','',$key);
227
					$ip_blocked2 = str_replace('del-','',$key);
230
					if ($ip_blocked1 == $ip_blocked2)
228
					if ($ip_blocked1 == $ip_blocked2)
231
				       		{
229
				       		{
232
						$remove_line = True;
230
						$remove_line = True;
233
						break;
231
						break;
234
						}
232
						}
235
					}
233
					}
236
				if (strstr($key,'chk-'))
234
				if (strstr($key,'chk-'))
237
					{
235
					{
238
					$ip_blocked2 = str_replace('chk-','',$key);
236
					$ip_blocked2 = str_replace('chk-','',$key);
239
					if ($ip_blocked1 == $ip_blocked2)
237
					if ($ip_blocked1 == $ip_blocked2)
240
				       		{
238
				       		{
241
						$actif = True;
239
						$actif = True;
242
						break;
240
						break;
243
						}
241
						}
244
					}
242
					}
245
				}
243
				}
246
			if (! $remove_line)
244
			if (! $remove_line)
247
				{
245
				{
248
				if (! $actif) {	$line="#$ip_blocked1 $ip_f[1]";}
246
				if (! $actif) {	$line="#$ip_blocked1 $ip_f[1]";}
249
				else { $line="$ip_blocked1 $ip_f[1]";}
247
				else { $line="$ip_blocked1 $ip_f[1]";}
250
				fwrite($pointeur,$line);
248
				fwrite($pointeur,$line);
251
				}
249
				}
252
			}
250
			}
253
		fclose($pointeur);
251
		fclose($pointeur);
254
		}
252
		}
255
	exec ("sudo /usr/local/bin/alcasar-iptables.sh");
253
	exec ("sudo /usr/local/bin/alcasar-iptables.sh");
256
	break;
254
	break;
257
	}
255
	}
258
# default values
256
# default values
259
if (is_file (CONF_FILE))
257
if (is_file (CONF_FILE))
260
	{
258
	{
261
	$tab=file(CONF_FILE);
259
	$tab=file(CONF_FILE);
262
	if ($tab)
260
	if ($tab)
263
		{
261
		{
264
		foreach ($tab as $line)
262
		foreach ($tab as $line)
265
			{
263
			{
266
			$field=explode("=", $line);
264
			$field=explode("=", $line);
267
			if ($field[0] == "PROTOCOLS_FILTERING")	{$PROTOCOLS_FILTERING=trim($field[1]);}
265
			if ($field[0] == "PROTOCOLS_FILTERING")	{$PROTOCOLS_FILTERING=trim($field[1]);}
268
			if ($field[0] == "WEB_ANTIVIRUS")	{$WEB_ANTIVIRUS=trim($field[1]);}
266
			if ($field[0] == "WEB_ANTIVIRUS")	{$WEB_ANTIVIRUS=trim($field[1]);}
269
			}
267
			}
270
		}
268
		}
271
	}
269
	}
272
echo "<tr><th>$l_title_antivir</th></tr>";
270
echo "<tr><th>$l_title_antivir</th></tr>";
273
?>
271
?>
274
<tr bgcolor=#FFCC66><td><img src=/images/pix.gif width=1 height=2></td></tr>
272
<tr bgcolor=#FFCC66><td><img src=/images/pix.gif width=1 height=2></td></tr>
275
</TABLE>
273
</TABLE>
276
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
274
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
277
	<tr><td valign="middle" align="left">
275
	<tr><td valign="middle" align="left">
278
<?php
276
<?php
279
if ($WEB_ANTIVIRUS == "on")
277
if ($WEB_ANTIVIRUS == "on")
280
	{
278
	{
281
	echo "<CENTER><H3>$l_antivir_on</H3></CENTER>";
279
	echo "<CENTER><H3>$l_antivir_on</H3></CENTER>";
282
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
280
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
283
	echo "<input type=hidden name='choix' value=\"AV_Off\">";
281
	echo "<input type=hidden name='choix' value=\"AV_Off\">";
284
	echo "<input type=submit value=\"$l_switch_antivir_off\">";
282
	echo "<input type=submit value=\"$l_switch_antivir_off\">";
285
}
283
}
286
else
284
else
287
	{
285
	{
288
	echo "<CENTER><H3>$l_antivir_off</H3></CENTER>";
286
	echo "<CENTER><H3>$l_antivir_off</H3></CENTER>";
289
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
287
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
290
	echo "<input type=hidden name='choix' value=\"AV_On\">";
288
	echo "<input type=hidden name='choix' value=\"AV_On\">";
291
	echo "<input type=submit value=\"$l_switch_antivir_on\">";
289
	echo "<input type=submit value=\"$l_switch_antivir_on\">";
292
	}
290
	}
293
?>
291
?>
294
</FORM>
292
</FORM>
295
</td></tr>
293
</td></tr>
296
</table>
294
</table>
297
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
295
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
298
<tr><th><?echo "$l_title_ip_block";?></th></tr>
296
<tr><th><?echo "$l_title_ip_block";?></th></tr>
299
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
297
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
300
</table>
298
</table>
301
<table width="100%" border=1 cellspacing=0 cellpadding=1>
299
<table width="100%" border=1 cellspacing=0 cellpadding=1>
302
<tr><td colspan=2 align="center">
300
<tr><td colspan=2 align="center">
303
<?
301
<?
304
echo "$l_ip_block_explain</td></tr>";
302
echo "$l_ip_block_explain</td></tr>";
305
echo "<tr><td align='center' valign='middle'>";
303
echo "<tr><td align='center' valign='middle'>";
306
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";
304
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";
307
echo "<input type=hidden name='choix' value=\"IP_block_filter\">";
305
echo "<input type=hidden name='choix' value=\"IP_block_filter\">";
308
echo "<table cellspacing=2 cellpadding=2 border=1>";
306
echo "<table cellspacing=2 cellpadding=2 border=1>";
309
echo "<tr><th>$l_blocked_ip_address<th>$l_blocked_ip_address_comment<th>$l_blocked<th>$l_remove</tr>";
307
echo "<tr><th>$l_blocked_ip_address<th>$l_blocked_ip_address_comment<th>$l_blocked<th>$l_remove</tr>";
310
// Read the "IP_block" file
308
// Read the "IP_block" file
311
$tab=file(IP_BLOCKED);
309
$tab=file(IP_BLOCKED);
312
if ($tab)  # the file isn't empty
310
if ($tab)  # the file isn't empty
313
	{
311
	{
314
	foreach ($tab as $line)
312
	foreach ($tab as $line)
315
		{
313
		{
316
		if (trim($line) != '') # the line isn't empty
314
		if (trim($line) != '') # the line isn't empty
317
			{
315
			{
318
			$blocked_ip=explode(" ", $line);
316
			$blocked_ip=explode(" ", $line);
319
			$ip_addr=trim($blocked_ip[0],"#");
317
			$ip_addr=trim($blocked_ip[0],"#");
320
			$comment=trim($blocked_ip[1]);
318
			$comment=trim($blocked_ip[1]);
321
			if ($comment ==''){$comment="&nbsp;";}
319
			if ($comment ==''){$comment="&nbsp;";}
322
			echo "<tr><td>$ip_addr<td>$comment";
320
			echo "<tr><td>$ip_addr<td>$comment";
323
			echo "<td><input type='checkbox' name='chk-$ip_addr'";
321
			echo "<td><input type='checkbox' name='chk-$ip_addr'";
324
			if (preg_match('/^#/',$line, $r)) {
322
			if (preg_match('/^#/',$line, $r)) {
325
				echo ">";}
323
				echo ">";}
326
			else {
324
			else {
327
				echo "checked>";}
325
				echo "checked>";}
328
			echo "<td>";
326
			echo "<td>";
329
			if (strcmp (trim($ip_addr),trim($conf["PUBLIC_IP"]))) {
327
			if (strcmp (trim($ip_addr),trim($conf["PUBLIC_IP"]))) {
330
				echo "<input type='checkbox' name='del-$ip_addr'>";}
328
				echo "<input type='checkbox' name='del-$ip_addr'>";}
331
			else {
329
			else {
332
				echo "&nbsp;";}
330
				echo "&nbsp;";}
333
			echo "</tr>";
331
			echo "</tr>";
334
			}
332
			}
335
		}
333
		}
336
	}
334
	}
337
?>
335
?>
338
</table>
336
</table>
339
<input type='hidden' name='choix' value='change_ip'>
337
<input type='hidden' name='choix' value='change_ip'>
340
<input type='submit' value='<?echo"$l_save";?>'>
338
<input type='submit' value='<?echo"$l_save";?>'>
341
</form></td><td valign='middle' align='center'>
339
</form></td><td valign='middle' align='center'>
342
<form action='<?echo"$_SERVER[PHP_SELF]"?>' method='POST'>
340
<form action='<?echo"$_SERVER[PHP_SELF]"?>' method='POST'>
343
<table cellspacing=2 cellpadding=3 border=1>
341
<table cellspacing=2 cellpadding=3 border=1>
344
<tr><th><?echo"$l_ip_address<th>$l_blocked_ip_address_comment";?>
342
<tr><th><?echo"$l_ip_address<th>$l_blocked_ip_address_comment";?>
345
<td></td></tr>
343
<td></td></tr>
346
<tr><td>exemple1 : 15.25.26.27 <br>exemple2 : 18.20.20.0/24</td><td>exemple1 : CERT alert<br>exemple2 : LAN of zombies</td><td></td></tr>
344
<tr><td>exemple1 : 15.25.26.27 <br>exemple2 : 18.20.20.0/24</td><td>exemple1 : CERT alert<br>exemple2 : LAN of zombies</td><td></td></tr>
347
<tr><td><input type='text' name='add_ip' size='17'></td>
345
<tr><td><input type='text' name='add_ip' size='17'></td>
348
<td><input type='text' name='add_comment' size='10'></td>
346
<td><input type='text' name='add_comment' size='10'></td>
349
<input type='hidden' name='choix' value='new_ip'>
347
<input type='hidden' name='choix' value='new_ip'>
350
<td><input type='submit' value='<?echo"$l_add_to_list";?>'></td>
348
<td><input type='submit' value='<?echo"$l_add_to_list";?>'></td>
351
</tr></table>
349
</tr></table>
352
</form>
350
</form>
353
</td></tr>
351
</td></tr>
354
</table>
352
</table>
355
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
353
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
356
<tr><th><?echo "$l_title_proto";?></th></tr>
354
<tr><th><?echo "$l_title_proto";?></th></tr>
357
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
355
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
358
</table>
356
</table>
359
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
357
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
360
<tr>
358
<tr>
361
<?
359
<?
362
if ($PROTOCOLS_FILTERING == "on")
360
if ($PROTOCOLS_FILTERING == "on")
363
	{
361
	{
364
	echo "<td colspan=\"2\" valign=\"middle\" align=\"left\">";
362
	echo "<td colspan=\"2\" valign=\"middle\" align=\"left\">";
365
	echo "<CENTER><H3>$l_netfilter_on</H3>$l_comment_on</CENTER>";
363
	echo "<CENTER><H3>$l_netfilter_on</H3>$l_comment_on</CENTER>";
366
	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
364
	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
367
	echo "<input type=hidden name='choix' value=\"NF_Off\">";
365
	echo "<input type=hidden name='choix' value=\"NF_Off\">";
368
	echo "<input type=submit value=\"$l_switch_off\">";
366
	echo "<input type=submit value=\"$l_switch_off\">";
369
	echo "</FORM></td></tr>";
367
	echo "</FORM></td></tr>";
370
	require ('net_filter2.php');
368
	require ('net_filter2.php');
371
	}
369
	}
372
else
370
else
373
	{
371
	{
374
	echo "<td valign=\"middle\" align=\"left\">";
372
	echo "<td valign=\"middle\" align=\"left\">";
375
	echo "<CENTER><H3>$l_netfilter_off</H3>$l_comment_off</CENTER>";
373
	echo "<CENTER><H3>$l_netfilter_off</H3>$l_comment_off</CENTER>";
376
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
374
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
377
	echo "<input type=hidden name='choix' value=\"NF_On\">";
375
	echo "<input type=hidden name='choix' value=\"NF_On\">";
378
	echo "<input type=submit value=\"$l_switch_on\">";
376
	echo "<input type=submit value=\"$l_switch_on\">";
379
	echo "</FORM></td></tr>";
377
	echo "</FORM></td></tr>";
380
	echo "</table></body></html>";
378
	echo "</table></body></html>";
381
	}
379
	}
382
?>
380
?>
383
 
381