Subversion Repositories ALCASAR

Rev

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

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