Subversion Repositories ALCASAR

Rev

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

Rev 2817 Rev 2853
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/acc.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
} else if($Language == 'es') {
-
 
47
    $l_load="Cargando...";
-
 
48
	$l_error_open_file	= "Error en la lectura del archivo";
-
 
49
	$l_trusted_domain	= "Sitios de Internet confiables";
-
 
50
	$l_domain		= "Nombres de Dominio";
-
 
51
	$l_comment_explain	= "Enlace mostrado en la página de interceptación";
46
}
-
 
-
 
52
	$l_comment_explain2	= "Dejar vacío para ocultar el enlace";
-
 
53
	$l_remove		= "Borrar de la lista";
-
 
54
	$l_trusted_ip		= "Direcciones IP confiables";
-
 
55
	$l_trusted_equipments	= "Equipos Autorizados (confiables)";
-
 
56
	$l_comment		= "Comentarios";
-
 
57
	$l_trusted_domain_explain = "Administra los sitios de Internet a los que se acceder sin iniciar sesión";
-
 
58
	$l_trusted_equipments_explain	= "Para permitir que un equipo se conecte a Internet sin interceptarlo, cree un usuario cuyo nombre sea la dirección MAC del dispositivo y la contraseña sea 'password'";
-
 
59
	$l_trusted_ip_explain	= "Administre direcciones IP de sistemas o direcciones IP de redes que pueden unirse sin autenticación";
-
 
60
	$l_submit		= "Enviar";
-
 
61
	$l_add_to_list		= "Agregar a la lista";
-
 
62
	$l_apply		= "Aplicar cambios";
47
else {
63
} else {
48
 	$l_load="Loading...";
64
 	$l_load="Loading...";
49
	$l_error_open_file	= "File open error";
65
	$l_error_open_file	= "File open error";
50
	$l_trusted_domain	= "Trusted Internet domain names";
66
	$l_trusted_domain	= "Trusted Internet domain names";
51
	$l_domain		= "Domain names";
67
	$l_domain		= "Domain names";
52
	$l_comment_explain	= "Link displayed in intercept page";
68
	$l_comment_explain	= "Link displayed in intercept page";
53
	$l_comment_explain2	= "Let empty to not display link";
69
	$l_comment_explain2	= "Let empty to not display link";
54
	$l_remove		= "Remove from list";
70
	$l_remove		= "Remove from list";
55
	$l_trusted_ip		= "Trusted IP addresses";
71
	$l_trusted_ip		= "Trusted IP addresses";
56
	$l_trusted_equipments	= "Trusted consultation equipements";
72
	$l_trusted_equipments	= "Trusted consultation equipements";
57
	$l_comment		= "Comments";
73
	$l_comment		= "Comments";
58
	$l_trusted_domain_explain = "Manage Internet domain names that can be joined without authentication";
74
	$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'";
75
	$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";
76
	$l_trusted_ip_explain	= "Manage systems IP addresses or networks IP addresses that can be joined without authentication";
61
	$l_submit		= "Submit";
77
	$l_submit		= "Submit";
62
	$l_add_to_list		= "Add to list";
78
	$l_add_to_list		= "Add to list";
63
	$l_apply		= "Apply changes";
79
	$l_apply		= "Apply changes";
64
}
80
}
65
if (isset($_POST['choix'])){ 
81
if (isset($_POST['choix'])){ 
66
	switch ($_POST['choix'])
82
	switch ($_POST['choix'])
67
	{
83
	{
68
	case 'new_uamdomain' :
84
	case 'new_uamdomain' :
69
	if (trim($_POST['add_uamdomain']) != "") 
85
	if (trim($_POST['add_uamdomain']) != "") 
70
		{
86
		{
71
		$tab=file(DOMAIN_ALLOWED_LIST);
87
		$tab=file(DOMAIN_ALLOWED_LIST);
72
		$insert = true;
88
		$insert = true;
73
		if ($tab) // file isn't empty
89
		if ($tab) // file isn't empty
74
			{
90
			{
75
			foreach ($tab as $line) // test if domain address doesn't already exist
91
			foreach ($tab as $line) // test if domain address doesn't already exist
76
				{
92
				{
77
				$domain=explode("\"", $line);
93
				$domain=explode("\"", $line);
78
				if (strcmp(trim($_POST['add_uamdomain']),$domain[1]) == 0)
94
				if (strcmp(trim($_POST['add_uamdomain']),$domain[1]) == 0)
79
			       		{
95
			       		{
80
					$insert = false;
96
					$insert = false;
81
					break;
97
					break;
82
					}
98
					}
83
				}
99
				}
84
			}
100
			}
85
		if ($insert == true) 
101
		if ($insert == true) 
86
			{
102
			{
87
			$line ="\nuamdomain=\"" . trim($_POST['add_uamdomain']) . "\" #" . trim($_POST['add_domain_comment']);
103
			$line ="\nuamdomain=\"" . trim($_POST['add_uamdomain']) . "\" #" . trim($_POST['add_domain_comment']);
88
			$pointeur=fopen(DOMAIN_ALLOWED_LIST,"a");
104
			$pointeur=fopen(DOMAIN_ALLOWED_LIST,"a");
89
			fwrite ($pointeur, $line);
105
			fwrite ($pointeur, $line);
90
			fclose ($pointeur);
106
			fclose ($pointeur);
91
			exec ("sudo /usr/local/bin/alcasar-file-clean.sh"); # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
107
			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 ! 
108
			sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
93
			exec ("sudo /usr/bin/systemctl restart chilli");
109
			exec ("sudo /usr/bin/systemctl restart chilli");
94
			}
110
			}
95
		}
111
		}
96
	break;
112
	break;
97
	case 'change_uamdomain' :
113
	case 'change_uamdomain' :
98
	$tab=file(DOMAIN_ALLOWED_LIST);
114
	$tab=file(DOMAIN_ALLOWED_LIST);
99
	if ($tab)
115
	if ($tab)
100
		{
116
		{
101
		$pointeur=fopen(DOMAIN_ALLOWED_LIST,"w+");
117
		$pointeur=fopen(DOMAIN_ALLOWED_LIST,"w+");
102
		foreach ($tab as $ligne)
118
		foreach ($tab as $ligne)
103
			{
119
			{
104
			$uamdomain1=explode("\"", $ligne);
120
			$uamdomain1=explode("\"", $ligne);
105
			$remove_line = false;
121
			$remove_line = false;
106
			foreach ($_POST as $key => $value)
122
			foreach ($_POST as $key => $value)
107
				{
123
				{
108
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
124
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
109
				if (strstr($key,'del-'))
125
				if (strstr($key,'del-'))
110
					{
126
					{
111
					$uamdomain2 = str_replace('del-','',$key);
127
					$uamdomain2 = str_replace('del-','',$key);
112
					if (strcmp($uamdomain1[1],$uamdomain2) == 0)
128
					if (strcmp($uamdomain1[1],$uamdomain2) == 0)
113
				       		{
129
				       		{
114
						$remove_line = True;
130
						$remove_line = True;
115
						break;
131
						break;
116
						}
132
						}
117
					}
133
					}
118
				}
134
				}
119
			if (! $remove_line)
135
			if (! $remove_line)
120
				{
136
				{
121
				fwrite($pointeur,$ligne);
137
				fwrite($pointeur,$ligne);
122
				}
138
				}
123
			}
139
			}
124
		fclose($pointeur);
140
		fclose($pointeur);
125
		}
141
		}
126
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
142
	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 ! 
143
	sleep (1); # be sure that dnsmasq-blackhole is restarted before killing tun0 ! 
128
	exec ("sudo /usr/bin/systemctl restart chilli");
144
	exec ("sudo /usr/bin/systemctl restart chilli");
129
	break;
145
	break;
130
	case 'new_ip' :
146
	case 'new_ip' :
131
		$ipAddr = trim($_POST['add_ip']);
147
		$ipAddr = trim($_POST['add_ip']);
132
		if (!preg_match('/^([0-9]{1,3}\.){3}([0-9]{1,3})$/', $ipAddr)) {
148
		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
149
			echo '<span style="color: red;">'.'Invalid IP address'.'</span>'; // TODO : need to translate
134
		} else if (!empty($ipAddr)) {
150
		} else if (!empty($ipAddr)) {
135
			$tab=file(IP_ALLOWED_LIST);
151
			$tab=file(IP_ALLOWED_LIST);
136
			$insert = true;
152
			$insert = true;
137
			if ($tab) { // file isn't empty
153
			if ($tab) { // file isn't empty
138
				foreach ($tab as $line) { // test if domain address doesn't already exist
154
				foreach ($tab as $line) { // test if domain address doesn't already exist
139
					$ip = explode('"', $line);
155
					$ip = explode('"', $line);
140
					if (strcmp($ipAddr, $ip[1]) === 0) {
156
					if (strcmp($ipAddr, $ip[1]) === 0) {
141
						$insert = false;
157
						$insert = false;
142
						break;
158
						break;
143
					}
159
					}
144
				}
160
				}
145
			}
161
			}
146
			if ($insert === true)  {
162
			if ($insert === true)  {
147
				$line = "\nuamallowed=\"" . $ipAddr .'" #' . trim($_POST['add_ip_comment']);
163
				$line = "\nuamallowed=\"" . $ipAddr .'" #' . trim($_POST['add_ip_comment']);
148
				$pointeur = fopen(IP_ALLOWED_LIST, 'a');
164
				$pointeur = fopen(IP_ALLOWED_LIST, 'a');
149
				fwrite($pointeur, $line);
165
				fwrite($pointeur, $line);
150
				fclose($pointeur);
166
				fclose($pointeur);
151
				exec('sudo /usr/local/bin/alcasar-file-clean.sh');  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
167
				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');
168
				exec('sudo /usr/bin/systemctl restart chilli');
153
			}
169
			}
154
		}
170
		}
155
	break;
171
	break;
156
	case 'change_ip' :
172
	case 'change_ip' :
157
	$tab=file(IP_ALLOWED_LIST);
173
	$tab=file(IP_ALLOWED_LIST);
158
	if ($tab)
174
	if ($tab)
159
		{
175
		{
160
		$pointeur=fopen(IP_ALLOWED_LIST,"w+");
176
		$pointeur=fopen(IP_ALLOWED_LIST,"w+");
161
		foreach ($tab as $ligne)
177
		foreach ($tab as $ligne)
162
			{
178
			{
163
			$ip1=explode("\"", $ligne);
179
			$ip1=explode("\"", $ligne);
164
			$remove_line = false;
180
			$remove_line = false;
165
			foreach ($_POST as $key => $value)
181
			foreach ($_POST as $key => $value)
166
				{
182
				{
167
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
183
				$key = str_replace ("_",".",$key); // dot are replace by '_' in post request
168
				if (strstr($key,'del-'))
184
				if (strstr($key,'del-'))
169
					{
185
					{
170
					$ip2 = str_replace('del-','',$key);
186
					$ip2 = str_replace('del-','',$key);
171
					if (strcmp($ip1[1],$ip2) == 0)
187
					if (strcmp($ip1[1],$ip2) == 0)
172
				       		{
188
				       		{
173
						$remove_line = True;
189
						$remove_line = True;
174
						break;
190
						break;
175
						}
191
						}
176
					}
192
					}
177
				}
193
				}
178
			if (! $remove_line)
194
			if (! $remove_line)
179
				{
195
				{
180
				fwrite($pointeur,$ligne);
196
				fwrite($pointeur,$ligne);
181
				}
197
				}
182
			}
198
			}
183
		fclose($pointeur);
199
		fclose($pointeur);
184
		}
200
		}
185
	exec ("sudo /usr/local/bin/alcasar-file-clean.sh");  # Clean & sort conf files. Add uamallowed domains to the dns-blackhole conf
201
	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");
202
	exec ("sudo /usr/bin/systemctl restart chilli");
187
	break;
203
	break;
188
	}
204
	}
189
}
205
}
190
?>
206
?>
191
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
207
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
192
<tr><th><?echo "$l_trusted_domain";?></th></tr>
208
<tr><th><?echo "$l_trusted_domain";?></th></tr>
193
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
209
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
194
</table>
210
</table>
195
<table width="100%" border=1 cellspacing=0 cellpadding=1>
211
<table width="100%" border=1 cellspacing=0 cellpadding=1>
196
<tr><td colspan=2 align="center">
212
<tr><td colspan=2 align="center">
197
<?
213
<?
198
echo "$l_trusted_domain_explain</td></tr>\n";
214
echo "$l_trusted_domain_explain</td></tr>\n";
199
echo "<tr><td align='center' valign='middle'>\n";
215
echo "<tr><td align='center' valign='middle'>\n";
200
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
216
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
201
echo "<table cellspacing=2 cellpadding=2 border=1>";
217
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";
218
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_domain<td>$l_comment_explain<td>$l_remove</tr>\n";
203
// Read the "Domain alowed" file
219
// Read the "Domain alowed" file
204
$tab=file(DOMAIN_ALLOWED_LIST);
220
$tab=file(DOMAIN_ALLOWED_LIST);
205
if ($tab)  # the file isn't empty
221
if ($tab)  # the file isn't empty
206
	{
222
	{
207
	foreach ($tab as $line)
223
	foreach ($tab as $line)
208
		{
224
		{
209
		if (trim($line) != '') # the line isn't empty
225
		if (trim($line) != '') # the line isn't empty
210
			{
226
			{
211
			$domain_allowed=explode("#", $line);
227
			$domain_allowed=explode("#", $line);
212
			$uamdomain=trim($domain_allowed[0],"#");
228
			$uamdomain=trim($domain_allowed[0],"#");
213
			$domain=explode("\"", $uamdomain);
229
			$domain=explode("\"", $uamdomain);
214
			echo "<tr><td>$domain[1]";
230
			echo "<tr><td>$domain[1]";
215
			echo "<td>";
231
			echo "<td>";
216
			if (isset ($domain_allowed[1])) {
232
			if (isset ($domain_allowed[1])) {
217
				echo trim($domain_allowed[1]);}
233
				echo trim($domain_allowed[1]);}
218
			else echo "&nbsp";
234
			else echo "&nbsp";
219
			echo "<td>";
235
			echo "<td>";
220
			echo "<input type='checkbox' name='del-$domain[1]'>";
236
			echo "<input type='checkbox' name='del-$domain[1]'>";
221
			echo "</tr>\n";
237
			echo "</tr>\n";
222
			}
238
			}
223
		}
239
		}
224
	}
240
	}
225
echo "</table>";
241
echo "</table>";
226
if ($tab)
242
if ($tab)
227
	{
243
	{
228
	echo "<input type='hidden' name='choix' value='change_uamdomain'>";
244
	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'>";
245
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
230
	}
246
	}
231
?>
247
?>
232
</form>
248
</form>
233
</td><td valign='middle' align='center'>
249
</td><td valign='middle' align='center'>
234
<form action='<?echo"$_SERVER[PHP_SELF]"?>' method='POST'>
250
<form action='<?echo"$_SERVER[PHP_SELF]"?>' method='POST'>
235
<table cellspacing=2 cellpadding=3 border=1>
251
<table cellspacing=2 cellpadding=3 border=1>
236
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_domain<td bgcolor='#d0ddb0'>$l_comment_explain";?>
252
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_domain<td bgcolor='#d0ddb0'>$l_comment_explain";?>
237
<td></tr>
253
<td></tr>
238
<tr><td>exemple1 : www.mydomain.com <br>exemple2 : .yourdomain.net
254
<tr><td>exemple1 : www.mydomain.com <br>exemple2 : .yourdomain.net
239
<td>exemple1 : mydomain<br><?echo "$l_comment_explain2";?><td></tr>
255
<td>exemple1 : mydomain<br><?echo "$l_comment_explain2";?><td></tr>
240
<tr><td><input type='text' name='add_uamdomain' size='20'>
256
<tr><td><input type='text' name='add_uamdomain' size='20'>
241
<td><input type='text' name='add_domain_comment' size='15'>
257
<td><input type='text' name='add_domain_comment' size='15'>
242
<input type='hidden' name='choix' value='new_uamdomain'></td>
258
<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";?>'>
259
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'>
244
</tr></table>
260
</tr></table>
245
</form>
261
</form>
246
</tr>
262
</tr>
247
</table>
263
</table>
248
<table width="100%" border="0" cellspacing="0" cellpadding="0">
264
<table width="100%" border="0" cellspacing="0" cellpadding="0">
249
	<tr><th><?php echo "$l_trusted_ip" ;?></th></tr>
265
	<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>
266
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
251
</table>
267
</table>
252
<table width="100%" border=1 cellspacing=0 cellpadding=1>
268
<table width="100%" border=1 cellspacing=0 cellpadding=1>
253
<tr><td colspan=2 align="center">
269
<tr><td colspan=2 align="center">
254
<?
270
<?
255
echo "$l_trusted_ip_explain</td></tr>\n";
271
echo "$l_trusted_ip_explain</td></tr>\n";
256
echo "<tr><td align='center' valign='middle'>\n";
272
echo "<tr><td align='center' valign='middle'>\n";
257
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
273
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
258
echo "<table cellspacing=2 cellpadding=2 border=1>";
274
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";
275
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_trusted_ip<td>$l_comment<td>$l_remove</tr>\n";
260
// Read the "ip alowed" file
276
// Read the "ip alowed" file
261
$tab=file(IP_ALLOWED_LIST);
277
$tab=file(IP_ALLOWED_LIST);
262
if ($tab)  # the file isn't empty
278
if ($tab)  # the file isn't empty
263
	{
279
	{
264
	foreach ($tab as $line)
280
	foreach ($tab as $line)
265
		{
281
		{
266
		if (trim($line) != '') # the line isn't empty
282
		if (trim($line) != '') # the line isn't empty
267
			{
283
			{
268
			$ip_allowed=explode("#", $line);
284
			$ip_allowed=explode("#", $line);
269
			$ip_a=trim($ip_allowed[0],"#");
285
			$ip_a=trim($ip_allowed[0],"#");
270
			$ip=explode("\"", $ip_a);
286
			$ip=explode("\"", $ip_a);
271
			echo "<tr><td>$ip[1]";
287
			echo "<tr><td>$ip[1]";
272
			echo "<td>";
288
			echo "<td>";
273
			if (isset($ip_allowed[1]))
289
			if (isset($ip_allowed[1]))
274
				echo trim($ip_allowed[1]);
290
				echo trim($ip_allowed[1]);
275
			else echo "&nbsp;";
291
			else echo "&nbsp;";
276
			echo "<td><input type='checkbox' name='del-$ip[1]'>";
292
			echo "<td><input type='checkbox' name='del-$ip[1]'>";
277
			echo "</tr>\n";
293
			echo "</tr>\n";
278
			}
294
			}
279
		}
295
		}
280
	}
296
	}
281
echo "</table>";
297
echo "</table>";
282
if ($tab)
298
if ($tab)
283
	{
299
	{
284
	echo "<input type='hidden' name='choix' value='change_ip'>";
300
	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'>";
301
	echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_apply'>";
286
	}
302
	}
287
?>
303
?>
288
</form>
304
</form>
289
</td><td valign='middle' align='center'>
305
</td><td valign='middle' align='center'>
290
<form action='<?echo "$_SERVER[PHP_SELF]"?>' method='POST'>
306
<form action='<?echo "$_SERVER[PHP_SELF]"?>' method='POST'>
291
<table cellspacing=2 cellpadding=3 border=1>
307
<table cellspacing=2 cellpadding=3 border=1>
292
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_trusted_ip<td bgcolor='#d0ddb0'>$l_comment";?>
308
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_trusted_ip<td bgcolor='#d0ddb0'>$l_comment";?>
293
<td></tr>
309
<td></tr>
294
<tr><td>exemple1 : 170.25.23.10 <br>exemple2 : 15.20.20.0/16</td>
310
<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>
311
<td>my_web_server <br>my_dmz<td></tr>
296
<tr><td><input type='text' name='add_ip' size='20'></td>
312
<tr><td><input type='text' name='add_ip' size='20'></td>
297
<td><input type='text' name='add_ip_comment' size='15'>
313
<td><input type='text' name='add_ip_comment' size='15'>
298
<input type='hidden' name='choix' value='new_ip'></td>
314
<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>
315
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'></td>
300
</tr></table>
316
</tr></table>
301
</form>
317
</form>
302
</table>
318
</table>
303
<table width="100%" border="0" cellspacing="0" cellpadding="0">
319
<table width="100%" border="0" cellspacing="0" cellpadding="0">
304
	<tr><th><?php echo "$l_trusted_equipments";?></th></tr>
320
	<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>
321
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
306
</table>
322
</table>
307
<table width="100%" border=1 cellspacing=0 cellpadding=1>
323
<table width="100%" border=1 cellspacing=0 cellpadding=1>
308
<tr><td colspan=2 align="center">
324
<tr><td colspan=2 align="center">
309
<?echo "$l_trusted_equipments_explain";?>
325
<?echo "$l_trusted_equipments_explain";?>
310
</td></tr>
326
</td></tr>
311
</table>
327
</table>
312
</BODY>
328
</BODY>
313
</HTML>
329
</HTML>
314
 
330