Subversion Repositories ALCASAR

Rev

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

Rev 2463 Rev 2817
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/acc.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"); # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
92
			sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
92
			sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
93
			exec ("sudo /usr/bin/systemctl restart chilli");
93
			exec ("sudo /usr/bin/systemctl restart chilli");
94
			}
94
			}
95
		}
95
		}
96
	break;
96
	break;
97
	case 'change_uamdomain' :
97
	case 'change_uamdomain' :
98
	$tab=file(DOMAIN_ALLOWED_LIST);
98
	$tab=file(DOMAIN_ALLOWED_LIST);
99
	if ($tab)
99
	if ($tab)
100
		{
100
		{
101
		$pointeur=fopen(DOMAIN_ALLOWED_LIST,"w+");
101
		$pointeur=fopen(DOMAIN_ALLOWED_LIST,"w+");
102
		foreach ($tab as $ligne)
102
		foreach ($tab as $ligne)
103
			{
103
			{
104
			$uamdomain1=explode("\"", $ligne);
104
			$uamdomain1=explode("\"", $ligne);
105
			$remove_line = false;
105
			$remove_line = false;
106
			foreach ($_POST as $key => $value)
106
			foreach ($_POST as $key => $value)
107
				{
107
				{
108
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
108
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
109
				if (strstr($key,'del-'))
109
				if (strstr($key,'del-'))
110
					{
110
					{
111
					$uamdomain2 = str_replace('del-','',$key);
111
					$uamdomain2 = str_replace('del-','',$key);
112
					if (strcmp($uamdomain1[1],$uamdomain2) == 0)
112
					if (strcmp($uamdomain1[1],$uamdomain2) == 0)
113
				       		{
113
				       		{
114
						$remove_line = True;
114
						$remove_line = True;
115
						break;
115
						break;
116
						}
116
						}
117
					}
117
					}
118
				}
118
				}
119
			if (! $remove_line)
119
			if (! $remove_line)
120
				{
120
				{
121
				fwrite($pointeur,$ligne);
121
				fwrite($pointeur,$ligne);
122
				}
122
				}
123
			}
123
			}
124
		fclose($pointeur);
124
		fclose($pointeur);
125
		}
125
		}
126
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
126
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
127
	sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
127
	sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
128
	exec ("sudo /usr/bin/systemctl restart chilli");
128
	exec ("sudo /usr/bin/systemctl restart chilli");
129
	break;
129
	break;
130
	case 'new_ip' :
130
	case 'new_ip' :
131
		$ipAddr = trim($_POST['add_ip']);
131
		$ipAddr = trim($_POST['add_ip']);
132
		if (!preg_match('/^([0-9]{1,3}\.){3}([0-9]{1,3})$/', $ipAddr)) {
132
		if (!preg_match('/^([0-9]{1,3}\.){3}([0-9]{1,3})$/', $ipAddr)) {
133
			echo '<span style="color: red;">'.'Invalid IP address'.'</span>'; // TODO : need to translate
133
			echo '<span style="color: red;">'.'Invalid IP address'.'</span>'; // TODO : need to translate
134
		} else if (!empty($ipAddr)) {
134
		} else if (!empty($ipAddr)) {
135
			$tab=file(IP_ALLOWED_LIST);
135
			$tab=file(IP_ALLOWED_LIST);
136
			$insert = true;
136
			$insert = true;
137
			if ($tab) { // file isn't empty
137
			if ($tab) { // file isn't empty
138
				foreach ($tab as $line) { // test if domain address doesn't already exist
138
				foreach ($tab as $line) { // test if domain address doesn't already exist
139
					$ip = explode('"', $line);
139
					$ip = explode('"', $line);
140
					if (strcmp($ipAddr, $ip[1]) === 0) {
140
					if (strcmp($ipAddr, $ip[1]) === 0) {
141
						$insert = false;
141
						$insert = false;
142
						break;
142
						break;
143
					}
143
					}
144
				}
144
				}
145
			}
145
			}
146
			if ($insert === true)  {
146
			if ($insert === true)  {
147
				$line = "\nuamallowed=\"" . $ipAddr .'" #' . trim($_POST['add_ip_comment']);
147
				$line = "\nuamallowed=\"" . $ipAddr .'" #' . trim($_POST['add_ip_comment']);
148
				$pointeur = fopen(IP_ALLOWED_LIST, 'a');
148
				$pointeur = fopen(IP_ALLOWED_LIST, 'a');
149
				fwrite($pointeur, $line);
149
				fwrite($pointeur, $line);
150
				fclose($pointeur);
150
				fclose($pointeur);
151
				exec('sudo /usr/local/bin/alcasar-file-clean.sh');  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
151
				exec('sudo /usr/local/bin/alcasar-file-clean.sh');  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
152
				exec('sudo /usr/bin/systemctl restart chilli');
152
				exec('sudo /usr/bin/systemctl restart chilli');
153
			}
153
			}
154
		}
154
		}
155
	break;
155
	break;
156
	case 'change_ip' :
156
	case 'change_ip' :
157
	$tab=file(IP_ALLOWED_LIST);
157
	$tab=file(IP_ALLOWED_LIST);
158
	if ($tab)
158
	if ($tab)
159
		{
159
		{
160
		$pointeur=fopen(IP_ALLOWED_LIST,"w+");
160
		$pointeur=fopen(IP_ALLOWED_LIST,"w+");
161
		foreach ($tab as $ligne)
161
		foreach ($tab as $ligne)
162
			{
162
			{
163
			$ip1=explode("\"", $ligne);
163
			$ip1=explode("\"", $ligne);
164
			$remove_line = false;
164
			$remove_line = false;
165
			foreach ($_POST as $key => $value)
165
			foreach ($_POST as $key => $value)
166
				{
166
				{
167
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
167
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
168
				if (strstr($key,'del-'))
168
				if (strstr($key,'del-'))
169
					{
169
					{
170
					$ip2 = str_replace('del-','',$key);
170
					$ip2 = str_replace('del-','',$key);
171
					if (strcmp($ip1[1],$ip2) == 0)
171
					if (strcmp($ip1[1],$ip2) == 0)
172
				       		{
172
				       		{
173
						$remove_line = True;
173
						$remove_line = True;
174
						break;
174
						break;
175
						}
175
						}
176
					}
176
					}
177
				}
177
				}
178
			if (! $remove_line)
178
			if (! $remove_line)
179
				{
179
				{
180
				fwrite($pointeur,$ligne);
180
				fwrite($pointeur,$ligne);
181
				}
181
				}
182
			}
182
			}
183
		fclose($pointeur);
183
		fclose($pointeur);
184
		}
184
		}
185
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
185
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
186
	exec ("sudo /usr/bin/systemctl restart chilli");
186
	exec ("sudo /usr/bin/systemctl restart chilli");
187
	break;
187
	break;
188
	}
188
	}
189
}
189
}
190
?>
190
?>
191
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
191
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
192
<tr><th><?echo "$l_trusted_domain";?></th></tr>
192
<tr><th><?echo "$l_trusted_domain";?></th></tr>
193
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
193
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
194
</table>
194
</table>
195
<table width="100%" border=1 cellspacing=0 cellpadding=1>
195
<table width="100%" border=1 cellspacing=0 cellpadding=1>
196
<tr><td colspan=2 align="center">
196
<tr><td colspan=2 align="center">
197
<?
197
<?
198
echo "$l_trusted_domain_explain</td></tr>\n";
198
echo "$l_trusted_domain_explain</td></tr>\n";
199
echo "<tr><td align='center' valign='middle'>\n";
199
echo "<tr><td align='center' valign='middle'>\n";
200
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
200
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
201
echo "<table cellspacing=2 cellpadding=2 border=1>";
201
echo "<table cellspacing=2 cellpadding=2 border=1>";
202
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_domain<td>$l_comment_explain<td>$l_remove</tr>\n";
202
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_domain<td>$l_comment_explain<td>$l_remove</tr>\n";
203
// Read the "Domain alowed" file
203
// Read the "Domain alowed" file
204
$tab=file(DOMAIN_ALLOWED_LIST);
204
$tab=file(DOMAIN_ALLOWED_LIST);
205
if ($tab)  # the file isn't empty
205
if ($tab)  # the file isn't empty
206
	{
206
	{
207
	foreach ($tab as $line)
207
	foreach ($tab as $line)
208
		{
208
		{
209
		if (trim($line) != '') # the line isn't empty
209
		if (trim($line) != '') # the line isn't empty
210
			{
210
			{
211
			$domain_allowed=explode("#", $line);
211
			$domain_allowed=explode("#", $line);
212
			$uamdomain=trim($domain_allowed[0],"#");
212
			$uamdomain=trim($domain_allowed[0],"#");
213
			$domain=explode("\"", $uamdomain);
213
			$domain=explode("\"", $uamdomain);
214
			echo "<tr><td>$domain[1]";
214
			echo "<tr><td>$domain[1]";
215
			echo "<td>";
215
			echo "<td>";
216
			if (isset ($domain_allowed[1])) {
216
			if (isset ($domain_allowed[1])) {
217
				echo trim($domain_allowed[1]);}
217
				echo trim($domain_allowed[1]);}
218
			else echo "&nbsp";
218
			else echo "&nbsp";
219
			echo "<td>";
219
			echo "<td>";
220
			echo "<input type='checkbox' name='del-$domain[1]'>";
220
			echo "<input type='checkbox' name='del-$domain[1]'>";
221
			echo "</tr>\n";
221
			echo "</tr>\n";
222
			}
222
			}
223
		}
223
		}
224
	}
224
	}
225
echo "</table>";
225
echo "</table>";
226
if ($tab)
226
if ($tab)
227
	{
227
	{
228
	echo "<input type='hidden' name='choix' value='change_uamdomain'>";
228
	echo "<input type='hidden' name='choix' value='change_uamdomain'>";
229
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
229
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
230
	}
230
	}
231
?>
231
?>
232
</form>
232
</form>
233
</td><td valign='middle' align='center'>
233
</td><td valign='middle' align='center'>
234
<form action='<?echo"$_SERVER[PHP_SELF]"?>' method='POST'>
234
<form action='<?echo"$_SERVER[PHP_SELF]"?>' method='POST'>
235
<table cellspacing=2 cellpadding=3 border=1>
235
<table cellspacing=2 cellpadding=3 border=1>
236
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_domain<td bgcolor='#d0ddb0'>$l_comment_explain";?>
236
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_domain<td bgcolor='#d0ddb0'>$l_comment_explain";?>
237
<td></tr>
237
<td></tr>
238
<tr><td>exemple1 : www.mydomain.com <br>exemple2 : .yourdomain.net
238
<tr><td>exemple1 : www.mydomain.com <br>exemple2 : .yourdomain.net
239
<td>exemple1 : mydomain<br><?echo "$l_comment_explain2";?><td></tr>
239
<td>exemple1 : mydomain<br><?echo "$l_comment_explain2";?><td></tr>
240
<tr><td><input type='text' name='add_uamdomain' size='20'>
240
<tr><td><input type='text' name='add_uamdomain' size='20'>
241
<td><input type='text' name='add_domain_comment' size='15'>
241
<td><input type='text' name='add_domain_comment' size='15'>
242
<input type='hidden' name='choix' value='new_uamdomain'></td>
242
<input type='hidden' name='choix' value='new_uamdomain'></td>
243
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'>
243
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'>
244
</tr></table>
244
</tr></table>
245
</form>
245
</form>
246
</tr>
246
</tr>
247
</table>
247
</table>
248
<table width="100%" border="0" cellspacing="0" cellpadding="0">
248
<table width="100%" border="0" cellspacing="0" cellpadding="0">
249
	<tr><th><?php echo "$l_trusted_ip" ;?></th></tr>
249
	<tr><th><?php echo "$l_trusted_ip" ;?></th></tr>
250
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
250
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
251
</table>
251
</table>
252
<table width="100%" border=1 cellspacing=0 cellpadding=1>
252
<table width="100%" border=1 cellspacing=0 cellpadding=1>
253
<tr><td colspan=2 align="center">
253
<tr><td colspan=2 align="center">
254
<?
254
<?
255
echo "$l_trusted_ip_explain</td></tr>\n";
255
echo "$l_trusted_ip_explain</td></tr>\n";
256
echo "<tr><td align='center' valign='middle'>\n";
256
echo "<tr><td align='center' valign='middle'>\n";
257
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
257
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
258
echo "<table cellspacing=2 cellpadding=2 border=1>";
258
echo "<table cellspacing=2 cellpadding=2 border=1>";
259
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_trusted_ip<td>$l_comment<td>$l_remove</tr>\n";
259
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_trusted_ip<td>$l_comment<td>$l_remove</tr>\n";
260
// Read the "ip alowed" file
260
// Read the "ip alowed" file
261
$tab=file(IP_ALLOWED_LIST);
261
$tab=file(IP_ALLOWED_LIST);
262
if ($tab)  # the file isn't empty
262
if ($tab)  # the file isn't empty
263
	{
263
	{
264
	foreach ($tab as $line)
264
	foreach ($tab as $line)
265
		{
265
		{
266
		if (trim($line) != '') # the line isn't empty
266
		if (trim($line) != '') # the line isn't empty
267
			{
267
			{
268
			$ip_allowed=explode("#", $line);
268
			$ip_allowed=explode("#", $line);
269
			$ip_a=trim($ip_allowed[0],"#");
269
			$ip_a=trim($ip_allowed[0],"#");
270
			$ip=explode("\"", $ip_a);
270
			$ip=explode("\"", $ip_a);
271
			echo "<tr><td>$ip[1]";
271
			echo "<tr><td>$ip[1]";
272
			echo "<td>";
272
			echo "<td>";
273
			if (isset($ip_allowed[1]))
273
			if (isset($ip_allowed[1]))
274
				echo trim($ip_allowed[1]);
274
				echo trim($ip_allowed[1]);
275
			else echo "&nbsp;";
275
			else echo "&nbsp;";
276
			echo "<td><input type='checkbox' name='del-$ip[1]'>";
276
			echo "<td><input type='checkbox' name='del-$ip[1]'>";
277
			echo "</tr>\n";
277
			echo "</tr>\n";
278
			}
278
			}
279
		}
279
		}
280
	}
280
	}
281
echo "</table>";
281
echo "</table>";
282
if ($tab)
282
if ($tab)
283
	{
283
	{
284
	echo "<input type='hidden' name='choix' value='change_ip'>";
284
	echo "<input type='hidden' name='choix' value='change_ip'>";
285
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
285
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
286
	}
286
	}
287
?>
287
?>
288
</form>
288
</form>
289
</td><td valign='middle' align='center'>
289
</td><td valign='middle' align='center'>
290
<form action='<?echo "$_SERVER[PHP_SELF]"?>' method='POST'>
290
<form action='<?echo "$_SERVER[PHP_SELF]"?>' method='POST'>
291
<table cellspacing=2 cellpadding=3 border=1>
291
<table cellspacing=2 cellpadding=3 border=1>
292
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_trusted_ip<td bgcolor='#d0ddb0'>$l_comment";?>
292
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_trusted_ip<td bgcolor='#d0ddb0'>$l_comment";?>
293
<td></tr>
293
<td></tr>
294
<tr><td>exemple1 : 170.25.23.10 <br>exemple2 : 15.20.20.0/16</td>
294
<tr><td>exemple1 : 170.25.23.10 <br>exemple2 : 15.20.20.0/16</td>
295
<td>my_web_server <br>my_dmz<td></tr>
295
<td>my_web_server <br>my_dmz<td></tr>
296
<tr><td><input type='text' name='add_ip' size='20'></td>
296
<tr><td><input type='text' name='add_ip' size='20'></td>
297
<td><input type='text' name='add_ip_comment' size='15'>
297
<td><input type='text' name='add_ip_comment' size='15'>
298
<input type='hidden' name='choix' value='new_ip'></td>
298
<input type='hidden' name='choix' value='new_ip'></td>
299
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'></td>
299
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'></td>
300
</tr></table>
300
</tr></table>
301
</form>
301
</form>
302
</table>
302
</table>
303
<table width="100%" border="0" cellspacing="0" cellpadding="0">
303
<table width="100%" border="0" cellspacing="0" cellpadding="0">
304
	<tr><th><?php echo "$l_trusted_equipments";?></th></tr>
304
	<tr><th><?php echo "$l_trusted_equipments";?></th></tr>
305
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
305
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
306
</table>
306
</table>
307
<table width="100%" border=1 cellspacing=0 cellpadding=1>
307
<table width="100%" border=1 cellspacing=0 cellpadding=1>
308
<tr><td colspan=2 align="center">
308
<tr><td colspan=2 align="center">
309
<?echo "$l_trusted_equipments_explain";?>
309
<?echo "$l_trusted_equipments_explain";?>
310
</td></tr>
310
</td></tr>
311
</table>
311
</table>
312
</BODY>
312
</BODY>
313
</HTML>
313
</HTML>
314
 
314