Subversion Repositories ALCASAR

Rev

Rev 3099 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

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