Subversion Repositories ALCASAR

Rev

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

Rev 841 Rev 868
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/style.css" type="text/css">
6
<link rel="stylesheet" href="/css/style.css" type="text/css">
7
</HEAD>
7
</HEAD>
8
<body>
8
<body>
9
<?
9
<?
10
$mac_allowed_list="/usr/local/etc/alcasar-macallowed";
10
$mac_allowed_list="/usr/local/etc/alcasar-macallowed";
11
$domain_allowed_list="/usr/local/etc/alcasar-uamdomain";
11
$domain_allowed_list="/usr/local/etc/alcasar-uamdomain";
12
$url_allowed_list="/usr/local/etc/alcasar-uamallowed";
12
$url_allowed_list="/usr/local/etc/alcasar-uamallowed";
13
# Choice of language
13
# Choice of language
14
$Language = 'en';
14
$Language = 'en';
15
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
15
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
16
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
16
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
17
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
17
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
18
if($Language == 'fr'){
18
if($Language == 'fr'){
19
  $l_error_open_file = "Erreur d'ouverture du fichier";
19
  $l_error_open_file = "Erreur d'ouverture du fichier";
20
  $l_trusted_sites = "Domaines Internet et adresses IP de confiance";
20
  $l_trusted_sites = "Noms de domaine et adresses IP Internet de confiance";
21
  $l_trusted_sites_explain1 = "Entrez ici les noms de domaine Internet ou les adresses IP pouvant &ecirc;tre joints sans authentification";
21
  $l_trusted_sites_explain1 = "Entrez ici les noms de domaine ou les adresses IP situés sur Internet pouvant &ecirc;tre joints sans authentification";
22
  $l_trusted_sites_explain2 = "Entrez un nom de domaine ou une adresse IP par ligne";
22
  $l_trusted_sites_explain2 = "Entrez un nom de domaine ou une adresse IP par ligne";
23
  $l_trusted_sites_list = "Liste de nom de domaine de confiance";
23
  $l_trusted_sites_list = "Liste des noms de domaine de confiance";
24
  $l_trusted_urls_list = "Liste d'adresses IP ou d'adresses de réseau de confiance";
24
  $l_trusted_urls_list = "Liste d'adresses IP ou d'adresses de réseau de confiance";
25
  $l_submit = "Enregistrer";
25
  $l_submit = "Enregistrer";
26
}
26
}
27
else {
27
else {
28
  $l_error_open_file = "File open error";
28
  $l_error_open_file = "File open error";
29
  $l_trusted_sites = "Trusted Internet domain and IP addresses";
29
  $l_trusted_sites = "Trusted Internet domain names and IP addresses";
30
  $l_trusted_sites_explain1 = "Enter Internet domain name or IP addresses that could be joined without authentication";
30
  $l_trusted_sites_explain1 = "Enter domain names or IP addresses situated on Internet that could be joined without authentication";
31
  $l_trusted_sites_explain2 = "Enter one domain name ou one IP address per line";
31
  $l_trusted_sites_explain2 = "Enter one domain name ou one IP address per line";
32
  $l_trusted_sites_list = "Trusted Internet domain list";
32
  $l_trusted_sites_list = "Trusted Internet domain names list";
33
  $l_trusted_urls_list = "Trusted IP addresses or networks addresses list";
33
  $l_trusted_urls_list = "Trusted IP addresses or networks addresses list";
34
  $l_submit = "Submit";
34
  $l_submit = "Submit";
35
}
35
}
36
if (isset($_POST['choix'])){ 
36
if (isset($_POST['choix'])){ 
37
	switch ($_POST['choix'])
37
	switch ($_POST['choix'])
38
	{
38
	{
39
	case 'MAJ_UAMALLOWED' :
39
	case 'MAJ_UAMALLOWED' :
40
		$tab_domains = explode ("\n", $_POST['trusted_domains']);
40
		$tab_domains = explode ("\n", $_POST['trusted_domains']);
41
		$fichier=fopen($domain_allowed_list,"w+");
41
		$fichier=fopen($domain_allowed_list,"w+");
42
		foreach ($tab_domains as $domain ){
42
		foreach ($tab_domains as $domain ){
43
			$tr_domain=trim($domain);
43
			$tr_domain=trim($domain);
44
			if ($tr_domain != ""){
44
			if ($tr_domain != ""){
45
				fputs ($fichier, "uamdomain=\"".$tr_domain."\"\n");}
45
				fputs ($fichier, "uamdomain=\"".$tr_domain."\"\n");}
46
			}	
46
			}	
47
		fclose($fichier);
47
		fclose($fichier);
48
		unset($_POST['trusted_domains']);
48
		unset($_POST['trusted_domains']);
49
		$tab_urls = explode ("\n", $_POST['trusted_urls']);
49
		$tab_urls = explode ("\n", $_POST['trusted_urls']);
50
		$fichier=fopen($url_allowed_list,"w+");
50
		$fichier=fopen($url_allowed_list,"w+");
51
		foreach ($tab_urls as $url ){
51
		foreach ($tab_urls as $url ){
52
			$tr_url=trim($url);
52
			$tr_url=trim($url);
53
			if ($tr_url != ""){
53
			if ($tr_url != ""){
54
				fputs ($fichier, "uamallowed=\"".$tr_url."\"\n");}
54
				fputs ($fichier, "uamallowed=\"".$tr_url."\"\n");}
55
			}
55
			}
56
		fclose($fichier);
56
		fclose($fichier);
57
		unset($_POST['trusted_urls']);
57
		unset($_POST['trusted_urls']);
58
		exec ("sudo service chilli restart");
58
		exec ("sudo service chilli restart");
59
		unset ($_POST['choix']);
59
		unset ($_POST['choix']);
60
		break;
60
		break;
61
	}	
61
	}	
62
}
62
}
63
?>
63
?>
64
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
64
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
65
	<tr><th><?php echo $l_trusted_sites ;?></th></tr>
65
	<tr><th><?php echo $l_trusted_sites ;?></th></tr>
66
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
66
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
67
</TABLE>
67
</TABLE>
68
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
68
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
69
	<tr bgcolor="#666666"><td>
69
	<tr bgcolor="#666666"><td>
70
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
70
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
71
		<tr><td valign="middle" align="left">
71
		<tr><td valign="middle" align="left">
72
		<center><?php
72
		<center><?php
73
		echo "$l_trusted_sites_explain1 <BR>";
73
		echo "$l_trusted_sites_explain1 <BR>";
74
		echo "$l_trusted_sites_explain2" ;
74
		echo "$l_trusted_sites_explain2" ;
75
		echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";?>
75
		echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";?>
76
		<TABLE cellspacing=2 cellpadding=3 border=1>
76
		<TABLE cellspacing=2 cellpadding=3 border=1>
77
		<tr><td width=50% height=100% align=center>
77
		<tr><td width=50% height=100% align=center>
78
			<H3><?php echo $l_trusted_sites_list ;?></H3>
78
			<H3><?php echo $l_trusted_sites_list ;?></H3>
79
			exemple1 : www.domain1.org<BR>
79
			exemple1 : www.domain1.org<BR>
80
			exemple2 : domain2.net<BR>
80
			exemple2 : domain2.net<BR>
81
			<?php
81
			<?php
82
				echo "<textarea name='trusted_domains' rows=5 cols=40>";
82
				echo "<textarea name='trusted_domains' rows=5 cols=40>";
83
				$ouvre=fopen($domain_allowed_list,"r");
83
				$ouvre=fopen($domain_allowed_list,"r");
84
				if ($ouvre)
84
				if ($ouvre)
85
					{
85
					{
86
					while (!feof ($ouvre))
86
					while (!feof ($ouvre))
87
						{
87
						{
88
						$tampon = fgets($ouvre, 4096);
88
						$tampon = fgets($ouvre, 4096);
89
						$domain_list_l = substr($tampon,10);
89
						$domain_list_l = substr($tampon,10);
90
						$domain_list = trim ($domain_list_l,"\"\n\t ");
90
						$domain_list = trim ($domain_list_l,"\"\n\t ");
91
						$tab_domains = explode (",", $domain_list);
91
						$tab_domains = explode (",", $domain_list);
92
						foreach ($tab_domains as $domain ){
92
						foreach ($tab_domains as $domain ){
93
							if ($domain) { echo $domain."\n";}
93
							if ($domain) { echo $domain."\n";}
94
							}
94
							}
95
		  				}
95
		  				}
96
					}
96
					}
97
				else	{
97
				else	{
98
					echo "failed to open $domain_allowed_list";
98
					echo "failed to open $domain_allowed_list";
99
					}
99
					}
100
				fclose($ouvre);
100
				fclose($ouvre);
101
				echo "</textarea>";
101
				echo "</textarea>";
102
			?>
102
			?>
103
		</td>
103
		</td>
104
		<td  width=50% height=100% align=center>
104
		<td  width=50% height=100% align=center>
105
			<H3><?php echo $l_trusted_urls_list ;?></H3>
105
			<H3><?php echo $l_trusted_urls_list ;?></H3>
106
			exemple1 : 192.168.0.10<BR>
106
			exemple1 : 192.168.0.10<BR>
107
			exemple2 : 172.16.20.0/24<BR>
107
			exemple2 : 172.16.20.0/24<BR>
108
			<?php
108
			<?php
109
				echo "<textarea name='trusted_urls' rows=5 cols=40>";
109
				echo "<textarea name='trusted_urls' rows=5 cols=40>";
110
				$ouvre=fopen($url_allowed_list,"r");
110
				$ouvre=fopen($url_allowed_list,"r");
111
				if ($ouvre)
111
				if ($ouvre)
112
			       		{
112
			       		{
113
					while (!feof ($ouvre))
113
					while (!feof ($ouvre))
114
						{
114
						{
115
						$tampon = fgets($ouvre, 4096);
115
						$tampon = fgets($ouvre, 4096);
116
						$url_list_l = substr($tampon,11);
116
						$url_list_l = substr($tampon,11);
117
						$url_list = trim ($url_list_l,"\"\n\t ");
117
						$url_list = trim ($url_list_l,"\"\n\t ");
118
						$tab_urls = explode (",", $url_list);
118
						$tab_urls = explode (",", $url_list);
119
						foreach ($tab_urls as $url ){
119
						foreach ($tab_urls as $url ){
120
							if ($url) echo $url."\n";
120
							if ($url) echo $url."\n";
121
							}
121
							}
122
						}
122
						}
123
					}
123
					}
124
				else	{
124
				else	{
125
					echo "failed to open $url_allowed_list";
125
					echo "failed to open $url_allowed_list";
126
					}
126
					}
127
				fclose($ouvre);
127
				fclose($ouvre);
128
				echo "</textarea>";
128
				echo "</textarea>";
129
			?>
129
			?>
130
		</td></tr>
130
		</td></tr>
131
		</TABLE>
131
		</TABLE>
132
		<input type='hidden' name='choix' value='MAJ_UAMALLOWED'>
132
		<input type='hidden' name='choix' value='MAJ_UAMALLOWED'>
133
		<input type='submit' value='<?php echo $l_submit ;?>'>
133
		<input type='submit' value='<?php echo $l_submit ;?>'>
134
		</FORM>
134
		</FORM>
135
	</td></tr>
135
	</td></tr>
136
	</TABLE>
136
	</TABLE>
137
</TABLE>
137
</TABLE>
138
</BODY>
138
</BODY>
139
</HTML>
139
</HTML>
140
 
140