Subversion Repositories ALCASAR

Rev

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

Rev 2138 Rev 2175
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 - 3abtux -->
2
<HTML><!-- written by Rexy - 3abtux -->
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>Exceptions</TITLE>
5
<TITLE>Exceptions</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
<?
9
<?
10
/********************
10
/********************
11
*  TEST CONF FILES  *
11
*  TEST CONF FILES  *
12
*********************/
12
*********************/
13
$domain_allowed_list="/usr/local/etc/alcasar-uamdomain";
13
$domain_allowed_list="/usr/local/etc/alcasar-uamdomain";
14
$url_allowed_list="/usr/local/etc/alcasar-uamallowed";
14
$url_allowed_list="/usr/local/etc/alcasar-uamallowed";
15
define ("DOMAIN_ALLOWED_LIST", $domain_allowed_list);
15
define ("DOMAIN_ALLOWED_LIST", $domain_allowed_list);
16
define ("IP_ALLOWED_LIST", $url_allowed_list);
16
define ("IP_ALLOWED_LIST", $url_allowed_list);
17
$conf_files=array(DOMAIN_ALLOWED_LIST,IP_ALLOWED_LIST);
17
$conf_files=array(DOMAIN_ALLOWED_LIST,IP_ALLOWED_LIST);
18
foreach ($conf_files as $file){
18
foreach ($conf_files as $file){
19
if (!file_exists($file)){
19
if (!file_exists($file)){
20
	exit("Requested file ".$file." isn't present");}
20
	exit("Requested file ".$file." isn't present");}
21
if (!is_readable($file)){
21
if (!is_readable($file)){
22
	exit("Can't read the file ".$file);}
22
	exit("Can't read the file ".$file);}
23
}
23
}
24
# Choice of language
24
# Choice of language
25
$Language = 'en';
25
$Language = 'en';
26
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
26
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
27
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
27
	$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
28
	$Language = strtolower(substr(chop($Langue[0]),0,2)); }
28
	$Language = strtolower(substr(chop($Langue[0]),0,2)); }
29
if($Language == 'fr'){
29
if($Language == 'fr'){
30
	$l_load="Chargement...";
30
	$l_load="Chargement...";
31
	$l_error_open_file	= "Erreur d'ouverture du fichier";
31
	$l_error_open_file	= "Erreur d'ouverture du fichier";
32
	$l_trusted_domain	= "Noms de domaine Internet de confiance";
32
	$l_trusted_domain	= "Noms de domaine Internet de confiance";
33
	$l_domain		= "Noms de domaine";
33
	$l_domain		= "Noms de domaine";
34
	$l_comment_explain	= "Lien affiché dans la page d'interception";
34
	$l_comment_explain	= "Lien affiché dans la page d'interception";
35
	$l_comment_explain2	= "Laissez vide si non affiché";
35
	$l_comment_explain2	= "Laissez vide si non affiché";
36
	$l_remove		= "Retirer de la liste";
36
	$l_remove		= "Retirer de la liste";
37
	$l_trusted_ip		= "adresses IP de confiance";
37
	$l_trusted_ip		= "adresses IP de confiance";
38
	$l_trusted_equipments	= "Equipements de consultation de confiance";
38
	$l_trusted_equipments	= "Equipements de consultation de confiance";
39
	$l_comment		= "Commentaires";
39
	$l_comment		= "Commentaires";
40
	$l_trusted_domain_explain = "Gérez ici les noms de domaine Internet pouvant être joints sans authentification";
40
	$l_trusted_domain_explain = "Gérez ici les noms de domaine Internet pouvant être joints sans authentification";
41
	$l_trusted_equipments_explain	= "Pour qu'un équipement du réseau de consultation puisse accéder à Internet sans être interceptés : créer un utilisateur dont le nom de login est l'@MAC de l'équipement et le mot de passe est 'password'" ;
41
	$l_trusted_equipments_explain	= "Pour qu'un équipement du réseau de consultation puisse accéder à Internet sans être interceptés : créer un utilisateur dont le nom de login est l'@MAC de l'équipement et le mot de passe est 'password'" ;
42
	$l_trusted_ip_explain	= "Gérez ici les adresses IP de systèmes ou de réseaux pouvant être joints sans authentification";
42
	$l_trusted_ip_explain	= "Gérez ici les adresses IP de systèmes ou de réseaux pouvant être joints sans authentification";
43
	$l_submit		= "Enregistrer";
43
	$l_submit		= "Enregistrer";
44
	$l_add_to_list		= "Ajouter à la liste";
44
	$l_add_to_list		= "Ajouter à la liste";
45
	$l_apply		= "Appliquer les changements";
45
	$l_apply		= "Appliquer les changements";
46
}
46
}
47
else {
47
else {
48
 	$l_load="Loading...";
48
 	$l_load="Loading...";
49
	$l_error_open_file	= "File open error";
49
	$l_error_open_file	= "File open error";
50
	$l_trusted_domain	= "Trusted Internet domain names";
50
	$l_trusted_domain	= "Trusted Internet domain names";
51
	$l_domain		= "Domain names";
51
	$l_domain		= "Domain names";
52
	$l_comment_explain	= "Link displayed in intercept page";
52
	$l_comment_explain	= "Link displayed in intercept page";
53
	$l_comment_explain2	= "Let empty to not display link";
53
	$l_comment_explain2	= "Let empty to not display link";
54
	$l_remove		= "Remove from list";
54
	$l_remove		= "Remove from list";
55
	$l_trusted_ip		= "Trusted IP addresses";
55
	$l_trusted_ip		= "Trusted IP addresses";
56
	$l_trusted_equipments	= "Trusted consultation equipements";
56
	$l_trusted_equipments	= "Trusted consultation equipements";
57
	$l_comment		= "Comments";
57
	$l_comment		= "Comments";
58
	$l_trusted_domain_explain = "Manage Internet domain names that can be joined without authentication";
58
	$l_trusted_domain_explain = "Manage Internet domain names that can be joined without authentication";
59
	$l_trusted_equipments_explain	= "To allow a consultation equipment to connect to Internet without interception, create a user whose name is the MAC address of the device and the password is 'password'";
59
	$l_trusted_equipments_explain	= "To allow a consultation equipment to connect to Internet without interception, create a user whose name is the MAC address of the device and the password is 'password'";
60
	  $l_trusted_ip_explain	= "Manage systems IP addresses or networks IP addresses that can be joined without authentication";
60
	  $l_trusted_ip_explain	= "Manage systems IP addresses or networks IP addresses that can be joined without authentication";
61
	$l_submit		= "Submit";
61
	$l_submit		= "Submit";
62
	$l_add_to_list		= "Add to list";
62
	$l_add_to_list		= "Add to list";
63
	$l_apply		= "Apply changes";
63
	$l_apply		= "Apply changes";
64
}
64
}
65
if (isset($_POST['choix'])){ 
65
if (isset($_POST['choix'])){ 
66
	switch ($_POST['choix'])
66
	switch ($_POST['choix'])
67
	{
67
	{
68
	case 'new_uamdomain' :
68
	case 'new_uamdomain' :
69
	if (trim($_POST['add_uamdomain']) != "") 
69
	if (trim($_POST['add_uamdomain']) != "") 
70
		{
70
		{
71
		$tab=file(DOMAIN_ALLOWED_LIST);
71
		$tab=file(DOMAIN_ALLOWED_LIST);
72
		$insert = true;
72
		$insert = true;
73
		if ($tab) // file isn't empty
73
		if ($tab) // file isn't empty
74
			{
74
			{
75
			foreach ($tab as $line) // test if domain address doesn't already exist
75
			foreach ($tab as $line) // test if domain address doesn't already exist
76
				{
76
				{
77
				$domain=explode("\"", $line);
77
				$domain=explode("\"", $line);
78
				if (strcmp(trim($_POST['add_uamdomain']),$domain[1]) == 0)
78
				if (strcmp(trim($_POST['add_uamdomain']),$domain[1]) == 0)
79
			       		{
79
			       		{
80
					$insert = false;
80
					$insert = false;
81
					break;
81
					break;
82
					}
82
					}
83
				}
83
				}
84
			}
84
			}
85
		if ($insert == true) 
85
		if ($insert == true) 
86
			{
86
			{
87
			$line ="\nuamdomain=\"" . trim($_POST['add_uamdomain']) . "\" #" . trim($_POST['add_domain_comment']);
87
			$line ="\nuamdomain=\"" . trim($_POST['add_uamdomain']) . "\" #" . trim($_POST['add_domain_comment']);
88
			$pointeur=fopen(DOMAIN_ALLOWED_LIST,"a");
88
			$pointeur=fopen(DOMAIN_ALLOWED_LIST,"a");
89
			fwrite ($pointeur, $line);
89
			fwrite ($pointeur, $line);
90
			fclose ($pointeur);
90
			fclose ($pointeur);
-
 
91
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh"); # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
91
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
92
			exec ("sudo /usr/bin/systemctl restart dnsmasq-blackhole");
-
 
93
			sleep 1 # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
92
			exec ("sudo /usr/bin/systemctl restart chilli");
94
			exec ("sudo /usr/bin/systemctl restart chilli");
93
			}
95
			}
94
		}
96
		}
95
	break;
97
	break;
96
	case 'change_uamdomain' :
98
	case 'change_uamdomain' :
97
	$tab=file(DOMAIN_ALLOWED_LIST);
99
	$tab=file(DOMAIN_ALLOWED_LIST);
98
	if ($tab)
100
	if ($tab)
99
		{
101
		{
100
		$pointeur=fopen(DOMAIN_ALLOWED_LIST,"w+");
102
		$pointeur=fopen(DOMAIN_ALLOWED_LIST,"w+");
101
		foreach ($tab as $ligne)
103
		foreach ($tab as $ligne)
102
			{
104
			{
103
			$uamdomain1=explode("\"", $ligne);
105
			$uamdomain1=explode("\"", $ligne);
104
			$remove_line = false;
106
			$remove_line = false;
105
			foreach ($_POST as $key => $value)
107
			foreach ($_POST as $key => $value)
106
				{
108
				{
107
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
109
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
108
				if (strstr($key,'del-'))
110
				if (strstr($key,'del-'))
109
					{
111
					{
110
					$uamdomain2 = str_replace('del-','',$key);
112
					$uamdomain2 = str_replace('del-','',$key);
111
					if (strcmp($uamdomain1[1],$uamdomain2) == 0)
113
					if (strcmp($uamdomain1[1],$uamdomain2) == 0)
112
				       		{
114
				       		{
113
						$remove_line = True;
115
						$remove_line = True;
114
						break;
116
						break;
115
						}
117
						}
116
					}
118
					}
117
				}
119
				}
118
			if (! $remove_line)
120
			if (! $remove_line)
119
				{
121
				{
120
				fwrite($pointeur,$ligne);
122
				fwrite($pointeur,$ligne);
121
				}
123
				}
122
			}
124
			}
123
		fclose($pointeur);
125
		fclose($pointeur);
124
		}
126
		}
-
 
127
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
-
 
128
	exec ("sudo /usr/bin/systemctl restart dnsmasq-blackhole");
-
 
129
	sleep 1 # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
125
	exec ("sudo /usr/bin/systemctl restart chilli");
130
	exec ("sudo /usr/bin/systemctl restart chilli");
126
	break;
131
	break;
127
	case 'new_ip' :
132
	case 'new_ip' :
128
	if (trim($_POST['add_ip']) != "") 
133
	if (trim($_POST['add_ip']) != "") 
129
		{
134
		{
130
		$tab=file(IP_ALLOWED_LIST);
135
		$tab=file(IP_ALLOWED_LIST);
131
		$insert = true;
136
		$insert = true;
132
		if ($tab) // file isn't empty
137
		if ($tab) // file isn't empty
133
			{
138
			{
134
			foreach ($tab as $line) // test if domain address doesn't already exist
139
			foreach ($tab as $line) // test if domain address doesn't already exist
135
				{
140
				{
136
				$ip=explode("\"", $line);
141
				$ip=explode("\"", $line);
137
				if (strcmp(trim($_POST['add_ip']),$ip[1]) == 0)
142
				if (strcmp(trim($_POST['add_ip']),$ip[1]) == 0)
138
			       		{
143
			       		{
139
					$insert = false;
144
					$insert = false;
140
					break;
145
					break;
141
					}
146
					}
142
				}
147
				}
143
			}
148
			}
144
		if ($insert == true) 
149
		if ($insert == true) 
145
			{
150
			{
146
			$line ="\nuamallowed=\"" . trim($_POST['add_ip']) ."\" #" . trim($_POST['add_ip_comment']);
151
			$line ="\nuamallowed=\"" . trim($_POST['add_ip']) ."\" #" . trim($_POST['add_ip_comment']);
147
			$pointeur=fopen(IP_ALLOWED_LIST,"a");
152
			$pointeur=fopen(IP_ALLOWED_LIST,"a");
148
			fwrite ($pointeur, $line);
153
			fwrite ($pointeur, $line);
149
			fclose ($pointeur);
154
			fclose ($pointeur);
150
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
155
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
151
			exec ("sudo /usr/bin/systemctl restart chilli");
156
			exec ("sudo /usr/bin/systemctl restart chilli");
152
			}
157
			}
153
		}
158
		}
154
	break;
159
	break;
155
	case 'change_ip' :
160
	case 'change_ip' :
156
	$tab=file(IP_ALLOWED_LIST);
161
	$tab=file(IP_ALLOWED_LIST);
157
	if ($tab)
162
	if ($tab)
158
		{
163
		{
159
		$pointeur=fopen(IP_ALLOWED_LIST,"w+");
164
		$pointeur=fopen(IP_ALLOWED_LIST,"w+");
160
		foreach ($tab as $ligne)
165
		foreach ($tab as $ligne)
161
			{
166
			{
162
			$ip1=explode("\"", $ligne);
167
			$ip1=explode("\"", $ligne);
163
			$remove_line = false;
168
			$remove_line = false;
164
			foreach ($_POST as $key => $value)
169
			foreach ($_POST as $key => $value)
165
				{
170
				{
166
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
171
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
167
				if (strstr($key,'del-'))
172
				if (strstr($key,'del-'))
168
					{
173
					{
169
					$ip2 = str_replace('del-','',$key);
174
					$ip2 = str_replace('del-','',$key);
170
					if (strcmp($ip1[1],$ip2) == 0)
175
					if (strcmp($ip1[1],$ip2) == 0)
171
				       		{
176
				       		{
172
						$remove_line = True;
177
						$remove_line = True;
173
						break;
178
						break;
174
						}
179
						}
175
					}
180
					}
176
				}
181
				}
177
			if (! $remove_line)
182
			if (! $remove_line)
178
				{
183
				{
179
				fwrite($pointeur,$ligne);
184
				fwrite($pointeur,$ligne);
180
				}
185
				}
181
			}
186
			}
182
		fclose($pointeur);
187
		fclose($pointeur);
183
		}
188
		}
-
 
189
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");
184
	exec ("sudo /usr/bin/systemctl restart chilli");
190
	exec ("sudo /usr/bin/systemctl restart chilli");
185
	break;
191
	break;
186
	}
192
	}
187
}
193
}
188
?>
194
?>
189
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
195
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
190
<tr><th><?echo "$l_trusted_domain";?></th></tr>
196
<tr><th><?echo "$l_trusted_domain";?></th></tr>
191
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
197
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
192
</table>
198
</table>
193
<table width="100%" border=1 cellspacing=0 cellpadding=1>
199
<table width="100%" border=1 cellspacing=0 cellpadding=1>
194
<tr><td colspan=2 align="center">
200
<tr><td colspan=2 align="center">
195
<?
201
<?
196
echo "$l_trusted_domain_explain</td></tr>\n";
202
echo "$l_trusted_domain_explain</td></tr>\n";
197
echo "<tr><td align='center' valign='middle'>\n";
203
echo "<tr><td align='center' valign='middle'>\n";
198
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
204
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
199
echo "<table cellspacing=2 cellpadding=2 border=1>";
205
echo "<table cellspacing=2 cellpadding=2 border=1>";
200
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_domain<td>$l_comment_explain<td>$l_remove</tr>\n";
206
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_domain<td>$l_comment_explain<td>$l_remove</tr>\n";
201
// Read the "Domain alowed" file
207
// Read the "Domain alowed" file
202
$tab=file(DOMAIN_ALLOWED_LIST);
208
$tab=file(DOMAIN_ALLOWED_LIST);
203
if ($tab)  # the file isn't empty
209
if ($tab)  # the file isn't empty
204
	{
210
	{
205
	foreach ($tab as $line)
211
	foreach ($tab as $line)
206
		{
212
		{
207
		if (trim($line) != '') # the line isn't empty
213
		if (trim($line) != '') # the line isn't empty
208
			{
214
			{
209
			$domain_allowed=explode("#", $line);
215
			$domain_allowed=explode("#", $line);
210
			$uamdomain=trim($domain_allowed[0],"#");
216
			$uamdomain=trim($domain_allowed[0],"#");
211
			$domain=explode("\"", $uamdomain);
217
			$domain=explode("\"", $uamdomain);
212
			echo "<tr><td>$domain[1]";
218
			echo "<tr><td>$domain[1]";
213
			echo "<td>";
219
			echo "<td>";
214
			if (isset ($domain_allowed[1])) {
220
			if (isset ($domain_allowed[1])) {
215
				echo trim($domain_allowed[1]);}
221
				echo trim($domain_allowed[1]);}
216
			else echo "&nbsp";
222
			else echo "&nbsp";
217
			echo "<td>";
223
			echo "<td>";
218
			echo "<input type='checkbox' name='del-$domain[1]'>";
224
			echo "<input type='checkbox' name='del-$domain[1]'>";
219
			echo "</tr>\n";
225
			echo "</tr>\n";
220
			}
226
			}
221
		}
227
		}
222
	}
228
	}
223
echo "</table>";
229
echo "</table>";
224
if ($tab)
230
if ($tab)
225
	{
231
	{
226
	echo "<input type='hidden' name='choix' value='change_uamdomain'>";
232
	echo "<input type='hidden' name='choix' value='change_uamdomain'>";
227
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
233
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
228
	}
234
	}
229
?>
235
?>
230
</form>
236
</form>
231
</td><td valign='middle' align='center'>
237
</td><td valign='middle' align='center'>
232
<form action='<?echo"$_SERVER[PHP_SELF]"?>' method='POST'>
238
<form action='<?echo"$_SERVER[PHP_SELF]"?>' method='POST'>
233
<table cellspacing=2 cellpadding=3 border=1>
239
<table cellspacing=2 cellpadding=3 border=1>
234
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_domain<td bgcolor='#d0ddb0'>$l_comment_explain";?>
240
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_domain<td bgcolor='#d0ddb0'>$l_comment_explain";?>
235
<td></tr>
241
<td></tr>
236
<tr><td>exemple1 : www.mydomain.com <br>exemple2 : .yourdomain.net
242
<tr><td>exemple1 : www.mydomain.com <br>exemple2 : .yourdomain.net
237
<td>exemple1 : mydomain<br><?echo "$l_comment_explain2";?><td></tr>
243
<td>exemple1 : mydomain<br><?echo "$l_comment_explain2";?><td></tr>
238
<tr><td><input type='text' name='add_uamdomain' size='20'>
244
<tr><td><input type='text' name='add_uamdomain' size='20'>
239
<td><input type='text' name='add_domain_comment' size='15'>
245
<td><input type='text' name='add_domain_comment' size='15'>
240
<input type='hidden' name='choix' value='new_uamdomain'></td>
246
<input type='hidden' name='choix' value='new_uamdomain'></td>
241
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'>
247
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'>
242
</tr></table>
248
</tr></table>
243
</form>
249
</form>
244
</tr>
250
</tr>
245
</table>
251
</table>
246
<table width="100%" border="0" cellspacing="0" cellpadding="0">
252
<table width="100%" border="0" cellspacing="0" cellpadding="0">
247
	<tr><th><?php echo "$l_trusted_ip" ;?></th></tr>
253
	<tr><th><?php echo "$l_trusted_ip" ;?></th></tr>
248
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
254
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
249
</table>
255
</table>
250
<table width="100%" border=1 cellspacing=0 cellpadding=1>
256
<table width="100%" border=1 cellspacing=0 cellpadding=1>
251
<tr><td colspan=2 align="center">
257
<tr><td colspan=2 align="center">
252
<?
258
<?
253
echo "$l_trusted_ip_explain</td></tr>\n";
259
echo "$l_trusted_ip_explain</td></tr>\n";
254
echo "<tr><td align='center' valign='middle'>\n";
260
echo "<tr><td align='center' valign='middle'>\n";
255
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
261
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
256
echo "<table cellspacing=2 cellpadding=2 border=1>";
262
echo "<table cellspacing=2 cellpadding=2 border=1>";
257
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_trusted_ip<td>$l_comment<td>$l_remove</tr>\n";
263
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_trusted_ip<td>$l_comment<td>$l_remove</tr>\n";
258
// Read the "ip alowed" file
264
// Read the "ip alowed" file
259
$tab=file(IP_ALLOWED_LIST);
265
$tab=file(IP_ALLOWED_LIST);
260
if ($tab)  # the file isn't empty
266
if ($tab)  # the file isn't empty
261
	{
267
	{
262
	foreach ($tab as $line)
268
	foreach ($tab as $line)
263
		{
269
		{
264
		if (trim($line) != '') # the line isn't empty
270
		if (trim($line) != '') # the line isn't empty
265
			{
271
			{
266
			$ip_allowed=explode("#", $line);
272
			$ip_allowed=explode("#", $line);
267
			$ip_a=trim($ip_allowed[0],"#");
273
			$ip_a=trim($ip_allowed[0],"#");
268
			$ip=explode("\"", $ip_a);
274
			$ip=explode("\"", $ip_a);
269
			echo "<tr><td>$ip[1]";
275
			echo "<tr><td>$ip[1]";
270
			echo "<td>";
276
			echo "<td>";
271
			if (isset($ip_allowed[1]))
277
			if (isset($ip_allowed[1]))
272
				echo trim($ip_allowed[1]);
278
				echo trim($ip_allowed[1]);
273
			else echo "&nbsp;";
279
			else echo "&nbsp;";
274
			echo "<td><input type='checkbox' name='del-$ip[1]'>";
280
			echo "<td><input type='checkbox' name='del-$ip[1]'>";
275
			echo "</tr>\n";
281
			echo "</tr>\n";
276
			}
282
			}
277
		}
283
		}
278
	}
284
	}
279
echo "</table>";
285
echo "</table>";
280
if ($tab)
286
if ($tab)
281
	{
287
	{
282
	echo "<input type='hidden' name='choix' value='change_ip'>";
288
	echo "<input type='hidden' name='choix' value='change_ip'>";
283
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
289
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
284
	}
290
	}
285
?>
291
?>
286
</form>
292
</form>
287
</td><td valign='middle' align='center'>
293
</td><td valign='middle' align='center'>
288
<form action='<?echo "$_SERVER[PHP_SELF]"?>' method='POST'>
294
<form action='<?echo "$_SERVER[PHP_SELF]"?>' method='POST'>
289
<table cellspacing=2 cellpadding=3 border=1>
295
<table cellspacing=2 cellpadding=3 border=1>
290
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_trusted_ip<td bgcolor='#d0ddb0'>$l_comment";?>
296
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_trusted_ip<td bgcolor='#d0ddb0'>$l_comment";?>
291
<td></tr>
297
<td></tr>
292
<tr><td>exemple1 : 170.25.23.10 <br>exemple2 : 15.20.20.0/16</td>
298
<tr><td>exemple1 : 170.25.23.10 <br>exemple2 : 15.20.20.0/16</td>
293
<td>my_web_server <br>my_dmz<td></tr>
299
<td>my_web_server <br>my_dmz<td></tr>
294
<tr><td><input type='text' name='add_ip' size='20'></td>
300
<tr><td><input type='text' name='add_ip' size='20'></td>
295
<td><input type='text' name='add_ip_comment' size='15'>
301
<td><input type='text' name='add_ip_comment' size='15'>
296
<input type='hidden' name='choix' value='new_ip'></td>
302
<input type='hidden' name='choix' value='new_ip'></td>
297
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'></td>
303
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'></td>
298
</tr></table>
304
</tr></table>
299
</form>
305
</form>
300
</table>
306
</table>
301
<table width="100%" border="0" cellspacing="0" cellpadding="0">
307
<table width="100%" border="0" cellspacing="0" cellpadding="0">
302
	<tr><th><?php echo "$l_trusted_equipments";?></th></tr>
308
	<tr><th><?php echo "$l_trusted_equipments";?></th></tr>
303
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
309
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
304
</table>
310
</table>
305
<table width="100%" border=1 cellspacing=0 cellpadding=1>
311
<table width="100%" border=1 cellspacing=0 cellpadding=1>
306
<tr><td colspan=2 align="center">
312
<tr><td colspan=2 align="center">
307
<?echo "$l_trusted_equipments_explain";?>
313
<?echo "$l_trusted_equipments_explain";?>
308
</td></tr>
314
</td></tr>
309
</table>
315
</table>
310
</BODY>
316
</BODY>
311
</HTML>
317
</HTML>
312
 
318