Subversion Repositories ALCASAR

Rev

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

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