Subversion Repositories ALCASAR

Rev

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

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