Subversion Repositories ALCASAR

Rev

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

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