Subversion Repositories ALCASAR

Rev

Rev 2083 | Rev 2175 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2083 Rev 2138
Line 8... Line 8...
8
<body>
8
<body>
9
<?
9
<?
10
/********************
10
/********************
11
*  TEST CONF FILES  *
11
*  TEST CONF FILES  *
12
*********************/
12
*********************/
13
define ("DOMAIN_ALLOWED_LIST", "/usr/local/etc/alcasar-uamdomain");
13
$domain_allowed_list="/usr/local/etc/alcasar-uamdomain";
14
define ("IP_ALLOWED_LIST", "/usr/local/etc/alcasar-uamallowed");
14
$url_allowed_list="/usr/local/etc/alcasar-uamallowed";
-
 
15
define ("DOMAIN_ALLOWED_LIST", $domain_allowed_list);
-
 
16
define ("IP_ALLOWED_LIST", $url_allowed_list);
15
$conf_files=array(DOMAIN_ALLOWED_LIST,IP_ALLOWED_LIST);
17
$conf_files=array(DOMAIN_ALLOWED_LIST,IP_ALLOWED_LIST);
16
foreach ($conf_files as $file){
18
foreach ($conf_files as $file){
17
if (!file_exists($file)){
19
if (!file_exists($file)){
18
	exit("Requested file ".$file." isn't present");}
20
	exit("Requested file ".$file." isn't present");}
19
if (!is_readable($file)){
21
if (!is_readable($file)){
20
	exit("Can't read the file ".$file);}
22
	exit("Can't read the file ".$file);}
21
}
23
}
22
$domain_allowed_list="/usr/local/etc/alcasar-uamdomain";
-
 
23
$url_allowed_list="/usr/local/etc/alcasar-uamallowed";
-
 
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)); }
Line 35... Line 35...
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 &ecirc;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";
Line 191... Line 191...
191
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
191
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
192
</table>
192
</table>
193
<table width="100%" border=1 cellspacing=0 cellpadding=1>
193
<table width="100%" border=1 cellspacing=0 cellpadding=1>
194
<tr><td colspan=2 align="center">
194
<tr><td colspan=2 align="center">
195
<?
195
<?
196
echo "$l_trusted_domain_explain</td></tr>";
196
echo "$l_trusted_domain_explain</td></tr>\n";
197
echo "<tr><td align='center' valign='middle'>";
197
echo "<tr><td align='center' valign='middle'>\n";
-
 
198
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
198
echo "<table cellspacing=2 cellpadding=2 border=1>";
199
echo "<table cellspacing=2 cellpadding=2 border=1>";
199
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";
-
 
200
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_domain<td>$l_comment_explain<td>$l_remove</tr>";
200
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_domain<td>$l_comment_explain<td>$l_remove</tr>\n";
201
// Read the "Domain alowed" file
201
// Read the "Domain alowed" file
202
$tab=file(DOMAIN_ALLOWED_LIST);
202
$tab=file(DOMAIN_ALLOWED_LIST);
203
if ($tab)  # the file isn't empty
203
if ($tab)  # the file isn't empty
204
	{
204
	{
205
	foreach ($tab as $line)
205
	foreach ($tab as $line)
Line 214... Line 214...
214
			if (isset ($domain_allowed[1])) {
214
			if (isset ($domain_allowed[1])) {
215
				echo trim($domain_allowed[1]);}
215
				echo trim($domain_allowed[1]);}
216
			else echo "&nbsp";
216
			else echo "&nbsp";
217
			echo "<td>";
217
			echo "<td>";
218
			echo "<input type='checkbox' name='del-$domain[1]'>";
218
			echo "<input type='checkbox' name='del-$domain[1]'>";
219
			echo "</tr>";
219
			echo "</tr>\n";
220
			}
220
			}
221
		}
221
		}
222
	}
222
	}
223
echo "</table>";
223
echo "</table>";
224
if ($tab)
224
if ($tab)
Line 235... Line 235...
235
<td></tr>
235
<td></tr>
236
<tr><td>exemple1 : www.mydomain.com <br>exemple2 : .yourdomain.net
236
<tr><td>exemple1 : www.mydomain.com <br>exemple2 : .yourdomain.net
237
<td>exemple1 : mydomain<br><?echo "$l_comment_explain2";?><td></tr>
237
<td>exemple1 : mydomain<br><?echo "$l_comment_explain2";?><td></tr>
238
<tr><td><input type='text' name='add_uamdomain' size='20'>
238
<tr><td><input type='text' name='add_uamdomain' size='20'>
239
<td><input type='text' name='add_domain_comment' size='15'>
239
<td><input type='text' name='add_domain_comment' size='15'>
240
<input type='hidden' name='choix' value='new_uamdomain'>
240
<input type='hidden' name='choix' value='new_uamdomain'></td>
241
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'>
241
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'>
242
</tr></table>
242
</tr></table>
243
</form>
243
</form>
244
</tr>
244
</tr>
245
</table>
245
</table>
Line 248... Line 248...
248
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
248
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
249
</table>
249
</table>
250
<table width="100%" border=1 cellspacing=0 cellpadding=1>
250
<table width="100%" border=1 cellspacing=0 cellpadding=1>
251
<tr><td colspan=2 align="center">
251
<tr><td colspan=2 align="center">
252
<?
252
<?
253
echo "$l_trusted_ip_explain</td></tr>";
253
echo "$l_trusted_ip_explain</td></tr>\n";
254
echo "<tr><td align='center' valign='middle'>";
254
echo "<tr><td align='center' valign='middle'>\n";
-
 
255
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>\n";
255
echo "<table cellspacing=2 cellpadding=2 border=1>";
256
echo "<table cellspacing=2 cellpadding=2 border=1>";
256
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";
-
 
257
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_trusted_ip<td>$l_comment<td>$l_remove</tr>";
257
echo "<tr align='center' bgcolor='#d0ddb0'><td>$l_trusted_ip<td>$l_comment<td>$l_remove</tr>\n";
258
// Read the "ip alowed" file
258
// Read the "ip alowed" file
259
$tab=file(IP_ALLOWED_LIST);
259
$tab=file(IP_ALLOWED_LIST);
260
if ($tab)  # the file isn't empty
260
if ($tab)  # the file isn't empty
261
	{
261
	{
262
	foreach ($tab as $line)
262
	foreach ($tab as $line)
Line 270... Line 270...
270
			echo "<td>";
270
			echo "<td>";
271
			if (isset($ip_allowed[1]))
271
			if (isset($ip_allowed[1]))
272
				echo trim($ip_allowed[1]);
272
				echo trim($ip_allowed[1]);
273
			else echo "&nbsp;";
273
			else echo "&nbsp;";
274
			echo "<td><input type='checkbox' name='del-$ip[1]'>";
274
			echo "<td><input type='checkbox' name='del-$ip[1]'>";
275
			echo "</tr>";
275
			echo "</tr>\n";
276
			}
276
			}
277
		}
277
		}
278
	}
278
	}
279
echo "</table>";
279
echo "</table>";
280
if ($tab)
280
if ($tab)
Line 290... Line 290...
290
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_trusted_ip<td bgcolor='#d0ddb0'>$l_comment";?>
290
<tr align='center'><td bgcolor='#d0ddb0'><?echo "$l_trusted_ip<td bgcolor='#d0ddb0'>$l_comment";?>
291
<td></tr>
291
<td></tr>
292
<tr><td>exemple1 : 170.25.23.10 <br>exemple2 : 15.20.20.0/16</td>
292
<tr><td>exemple1 : 170.25.23.10 <br>exemple2 : 15.20.20.0/16</td>
293
<td>my_web_server <br>my_dmz<td></tr>
293
<td>my_web_server <br>my_dmz<td></tr>
294
<tr><td><input type='text' name='add_ip' size='20'></td>
294
<tr><td><input type='text' name='add_ip' size='20'></td>
295
<td><input type='text' name='add_ip_comment' size='15'></td>
295
<td><input type='text' name='add_ip_comment' size='15'>
296
<input type='hidden' name='choix' value='new_ip'>
296
<input type='hidden' name='choix' value='new_ip'></td>
297
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'></td>
297
<td><input type='submit' onClick="this.disabled=true; this.value='<?echo $l_load;?>';submit();" value='<?echo "$l_add_to_list";?>'></td>
298
</tr></table>
298
</tr></table>
299
</td></tr>
-
 
300
</table>
-
 
301
</form>
299
</form>
-
 
300
</table>
302
<table width="100%" border="0" cellspacing="0" cellpadding="0">
301
<table width="100%" border="0" cellspacing="0" cellpadding="0">
303
	<tr><th><?php echo "$l_trusted_equipments";?></th></tr>
302
	<tr><th><?php echo "$l_trusted_equipments";?></th></tr>
304
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
303
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
305
</table>
304
</table>
306
<table width="100%" border=1 cellspacing=0 cellpadding=1>
305
<table width="100%" border=1 cellspacing=0 cellpadding=1>