Subversion Repositories ALCASAR

Rev

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

Rev 498 Rev 504
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
# Choice of language
11
# Choice of language
11
$Language = 'en';
12
$Language = 'en';
12
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
13
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
13
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
14
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
14
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
15
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
15
if($Language == 'fr'){
16
if($Language == 'fr'){
16
  $l_error_open_file = "Erreur d'ouverture du fichier";
17
  $l_error_open_file = "Erreur d'ouverture du fichier";
17
  $l_trusted_sites = "Sites Internet de confiance";
18
  $l_trusted_sites = "Sites Internet de confiance";
18
  $l_trusted_sites_explain1 = "Entrez ici les noms de site ou d'URLs Internet pouvant &ecirc;tre joints sans authentification";
19
  $l_trusted_sites_explain1 = "Entrez ici les noms de site ou d'URLs Internet pouvant &ecirc;tre joints sans authentification";
19
  $l_trusted_sites_explain2 = "Entrez un nom par ligne";
20
  $l_trusted_sites_explain2 = "Entrez un nom par ligne";
20
  $l_trusted_sites_list = "Liste de sites Internet de confiance";
21
  $l_trusted_sites_list = "Liste de sites Internet de confiance";
21
  $l_trusted_urls_list = "Liste d'URLs Internet de confiance";
22
  $l_trusted_urls_list = "Liste d'URLs Internet de confiance";
22
  $l_trusted_mac = "&Eacute;quipements de confiance";
23
  $l_trusted_mac = "&Eacute;quipements de confiance";
23
  $l_trusted_mac_explain = "Entrez ici les adresses MAC des &eacute;quipements autorisés à joindre Internet sans authentification";
24
  $l_trusted_mac_explain = "Entrez ici les adresses MAC des &eacute;quipements autorisés à joindre Internet sans authentification";
24
  $l_trusted_mac_list = "Liste des adresses MAC de confiance";
25
  $l_trusted_mac_list = "Liste des adresses MAC de confiance";
25
  $l_trusted_mac_address = "Adresse MAC autorisées";
26
  $l_trusted_mac_address = "Adresses MAC autorisées";
26
  $l_trusted_mac_info = "Information équipement";
27
  $l_trusted_mac_info = "Information équipement";
27
  $l_trusted_mac_del = "Supprimer de la liste";
28
  $l_trusted_mac_del = "Supprimer de la liste";
28
  $l_submit = "Enregistrer";
29
  $l_submit = "Enregistrer";
-
 
30
  $l_add_to_list = "Ajouter";
29
}
31
}
30
else {
32
else {
31
  $l_error_open_file = "File open error";
33
  $l_error_open_file = "File open error";
32
  $l_trusted_sites = "Trusted Internet sites";
34
  $l_trusted_sites = "Trusted Internet sites";
33
  $l_trusted_sites_explain1 = "Enter name of Internet sites or URLS that could be joined without authentication";
35
  $l_trusted_sites_explain1 = "Enter name of Internet sites or URLS that could be joined without authentication";
34
  $l_trusted_sites_explain2 = "Enter one name per line";
36
  $l_trusted_sites_explain2 = "Enter one name per line";
35
  $l_trusted_sites_list = "Trusted Internet sites list";
37
  $l_trusted_sites_list = "Trusted Internet sites list";
36
  $l_trusted_urls_list = "Trusted Internet URLs list";
38
  $l_trusted_urls_list = "Trusted Internet URLs list";
37
  $l_trusted_mac = "Trusted Equipments";
39
  $l_trusted_mac = "Trusted Equipments";
38
  $l_trusted_mac_explain = "Enter MAC address of equipments that could contact Internet without authentification";
40
  $l_trusted_mac_explain = "Enter MAC address of equipments that could contact Internet without authentication";
39
  $l_trusted_mac_list = "Trusted MAC addresses list";
41
  $l_trusted_mac_list = "Trusted MAC addresses list";
40
  $l_trusted_mac_address = "Allowed MAC adress MAC"; 
42
  $l_trusted_mac_address = "Allowed MAC adress"; 
41
  $l_trusted_mac_info = "Equipment information";
43
  $l_trusted_mac_info = "Equipment information";
42
  $l_trusted_mac_del = "Delete from list";
44
  $l_trusted_mac_del = "Delete from list";
43
  $l_submit = "Submit";
45
  $l_submit = "Submit";
44
 
-
 
-
 
46
  $l_add_to_list = "Add";
45
}
47
}
46
if (isset($_POST['choix'])){ 
48
if (isset($_POST['choix'])){ 
47
	switch ($_POST['choix'])
49
	switch ($_POST['choix'])
48
	{
50
	{
49
	case 'MAJ_UAMALLOWED' :
51
	case 'MAJ_UAMALLOWED' :
50
		$nb_domain=0;
52
		$nb_domain=0;
51
		$tab_domains = explode ("\n", $_POST['trusted_domains']);
53
		$tab_domains = explode ("\n", $_POST['trusted_domains']);
52
		$fichier=fopen("/usr/local/etc/alcasar-uamdomain","w+");
54
		$fichier=fopen("/usr/local/etc/alcasar-uamdomain","w+");
53
		fputs ($fichier, "uamdomain=\"");
55
		fputs ($fichier, "uamdomain=\"");
54
		foreach ($tab_domains as $domain ){
56
		foreach ($tab_domains as $domain ){
55
			$tr_domain=trim($domain);
57
			$tr_domain=trim($domain);
56
			$nb_domain++;
58
			$nb_domain++;
57
			if ($tr_domain != ""){
59
			if ($tr_domain != ""){
58
				if ($nb_domain>1) fputs ($fichier, ",".$tr_domain);
60
				if ($nb_domain>1) fputs ($fichier, ",".$tr_domain);
59
				else fputs ($fichier, $tr_domain);
61
				else fputs ($fichier, $tr_domain);
60
				}
62
				}
61
			}	
63
			}	
62
		fputs($fichier, "\"");
64
		fputs($fichier, "\"");
63
		fclose($fichier);
65
		fclose($fichier);
64
		unset($_POST['trusted_domains']);
66
		unset($_POST['trusted_domains']);
65
		unset($nb_domain);
67
		unset($nb_domain);
66
		$nb_url=0;
68
		$nb_url=0;
67
		$tab_urls = explode ("\n", $_POST['trusted_urls']);
69
		$tab_urls = explode ("\n", $_POST['trusted_urls']);
68
		$fichier=fopen("/usr/local/etc/alcasar-uamallowed","w+");
70
		$fichier=fopen("/usr/local/etc/alcasar-uamallowed","w+");
69
		fputs ($fichier, "uamallowed=\"");
71
		fputs ($fichier, "uamallowed=\"");
70
		foreach ($tab_urls as $url ){
72
		foreach ($tab_urls as $url ){
71
			$tr_url=trim($url);
73
			$tr_url=trim($url);
72
			$nb_url++;
74
			$nb_url++;
73
			if ($tr_url != ""){
75
			if ($tr_url != ""){
74
				if ($nb_url>1) fputs ($fichier, ",".$tr_url);
76
				if ($nb_url>1) fputs ($fichier, ",".$tr_url);
75
				else fputs ($fichier, $tr_url);
77
				else fputs ($fichier, $tr_url);
76
				}
78
				}
77
			}
79
			}
78
		fputs($fichier, "\"");
80
		fputs($fichier, "\"");
79
		fclose($fichier);
81
		fclose($fichier);
80
		unset($_POST['trusted_urls']);
82
		unset($_POST['trusted_urls']);
81
		unset($nb_url);
83
		unset($nb_url);
82
		exec ("sudo service chilli restart");
84
		exec ("sudo service chilli restart");
83
		unset ($_POST['choix']);
85
		unset ($_POST['choix']);
84
		break;
86
		break;
85
	case 'MAJ_MACALLOWED' :
87
case 'new_mac' :
-
 
88
	if (trim($_POST['add_mac']) != "")
-
 
89
		{
-
 
90
		if (is_file ($mac_allowed_list)) # le fichier existe
-
 
91
			{
-
 
92
			$tab=file($mac_allowed_list);
86
		$nb_mac=0;
93
			$insert = true;
87
		$tab_macs = explode ("\n", $_POST['trusted_macs']);
94
			if ($tab)  # le fichier n'est pas vide
-
 
95
				{
88
		$fichier=fopen("/usr/local/etc/alcasar-macallowed","w+");
96
				foreach ($tab as $line)  # on teste si l'adresse mac n'est pas déjà présente
-
 
97
					{
-
 
98
					$field=explode("#", $line);
89
		fputs ($fichier, "macallowed=\"");
99
					$mac_addr=trim($field[0],"macallowed=");
90
		foreach ($tab_macs as $macs ){
100
					if (trim($_POST['add_mac']) == trim ($mac_addr))
-
 
101
						{
91
			$tr_macs=trim($macs);
102
						$insert = false;;
92
			$nb_mac++;
103
						break;
-
 
104
						}
-
 
105
					}
-
 
106
				}
93
			if ($tr_macs != ""){
107
			if ($insert == true) 
-
 
108
				{
-
 
109
				$line = "macallowed=" . trim($_POST['add_mac']) . " #" . trim($_POST['add_comment']) . "\n";
94
				if ($nb_mac>1) fputs ($fichier, ",".$tr_macs);
110
				$pointeur=fopen($mac_allowed_list,"a");
95
				else fputs ($fichier, $tr_macs);
111
				fwrite ($pointeur, $line);
-
 
112
				fclose ($pointeur);
-
 
113
				exec ("sudo service chilli restart");
96
				}
114
				}
97
			}
115
			}
-
 
116
		else {echo "$l_error_open_file $mac_allowed_list";}
-
 
117
		}
-
 
118
	break;
-
 
119
case 'del_mac' :
-
 
120
	$tab=file($mac_allowed_list);
-
 
121
	if ($tab)
-
 
122
		{
-
 
123
		$pointeur=fopen($mac_allowed_list,"w+");
98
		fputs($fichier, "\"");
124
		foreach ($tab as $line)
-
 
125
			{
99
		fclose($fichier);
126
			$field=explode("#", $line);
-
 
127
			$mac_addr=trim(trim($field[0],"macallowed="));
-
 
128
			$remove_line = false;
100
		unset($_POST['trusted_macs']);
129
			foreach ($_POST as $key => $value)
-
 
130
				{
-
 
131
				if ($mac_addr == $key)
-
 
132
			       		{
-
 
133
					$remove_line = True;
-
 
134
					break;
-
 
135
					}
-
 
136
				}
-
 
137
			if (! $remove_line) {fwrite($pointeur,$line);}
-
 
138
			}
101
		unset($nb_mac);
139
		fclose($pointeur);
102
		exec ("sudo service chilli restart");
140
		exec ("sudo service chilli restart");
-
 
141
		}
103
		unset ($_POST['choix']);
142
	else {echo "$l_error_open_file $mac_allowed_list";}
104
		break;
143
	break;
105
	}	
144
	}	
106
}
145
}
107
?>
146
?>
108
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
147
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
109
	<tr><th><?php echo $l_trusted_sites ;?></th></tr>
148
	<tr><th><?php echo $l_trusted_sites ;?></th></tr>
110
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
149
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
111
</TABLE>
150
</TABLE>
112
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
151
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
113
	<tr bgcolor="#666666"><td>
152
	<tr bgcolor="#666666"><td>
114
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
153
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
115
		<tr><td valign="middle" align="left">
154
		<tr><td valign="middle" align="left">
116
		<center><?php
155
		<center><?php
117
		echo "$l_trusted_sites_explain1 <BR>";
156
		echo "$l_trusted_sites_explain1 <BR>";
118
		echo "$l_trusted_sites_explain2" ;
157
		echo "$l_trusted_sites_explain2" ;
119
		echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";?>
158
		echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";?>
120
		<TABLE cellspacing=2 cellpadding=3 border=1>
159
		<TABLE cellspacing=2 cellpadding=3 border=1>
121
		<tr><td width=50% height=100% align=center>
160
		<tr><td width=50% height=100% align=center>
122
			<H3><?php echo $l_trusted_sites_list ;?></H3>
161
			<H3><?php echo $l_trusted_sites_list ;?></H3>
123
			exemple1 : www.domain1.org<BR>
162
			exemple1 : www.domain1.org<BR>
124
			exemple2 : domain2.net<BR>
163
			exemple2 : domain2.net<BR>
125
			<?php
164
			<?php
126
				echo "<textarea name='trusted_domains' rows=5 cols=40>";
165
				echo "<textarea name='trusted_domains' rows=5 cols=40>";
127
				$trusted_domains_file="/usr/local/etc/alcasar-uamdomain";
166
				$trusted_domains_file="/usr/local/etc/alcasar-uamdomain";
128
				$ouvre=fopen($trusted_domains_file,"r");
167
				$ouvre=fopen($trusted_domains_file,"r");
129
				if ($ouvre)
168
				if ($ouvre)
130
					{
169
					{
131
					while (!feof ($ouvre))
170
					while (!feof ($ouvre))
132
						{
171
						{
133
						$tampon = fgets($ouvre, 4096);
172
						$tampon = fgets($ouvre, 4096);
134
						$domain_list_l = substr($tampon,10);
173
						$domain_list_l = substr($tampon,10);
135
						$domain_list = trim ($domain_list_l,"\"\n\t ");
174
						$domain_list = trim ($domain_list_l,"\"\n\t ");
136
						$tab_domains = explode (",", $domain_list);
175
						$tab_domains = explode (",", $domain_list);
137
						foreach ($tab_domains as $domain ){
176
						foreach ($tab_domains as $domain ){
138
							if ($domain) { echo $domain."\n";}
177
							if ($domain) { echo $domain."\n";}
139
							}
178
							}
140
		  				}
179
		  				}
141
					}
180
					}
142
				else	{
181
				else	{
143
					echo "failed to open $trusted_domains_file";
182
					echo "failed to open $trusted_domains_file";
144
					}
183
					}
145
				fclose($ouvre);
184
				fclose($ouvre);
146
				echo "</textarea>";
185
				echo "</textarea>";
147
			?>
186
			?>
148
		</td>
187
		</td>
149
		<td  width=50% height=100% align=center>
188
		<td  width=50% height=100% align=center>
150
			<H3><?php echo $l_trusted_urls_list ;?></H3>
189
			<H3><?php echo $l_trusted_urls_list ;?></H3>
151
			exemple1 : www.domain3.net/admin/index.htm<BR>
190
			exemple1 : www.domain3.net/admin/index.htm<BR>
152
			exemple2 : domain4.org/~polux/index.html<BR>
191
			exemple2 : domain4.org/~polux/index.html<BR>
153
			<?php
192
			<?php
154
				echo "<textarea name='trusted_urls' rows=5 cols=40>";
193
				echo "<textarea name='trusted_urls' rows=5 cols=40>";
155
				$trusted_urls_file="/usr/local/etc/alcasar-uamallowed";
194
				$trusted_urls_file="/usr/local/etc/alcasar-uamallowed";
156
				$ouvre=fopen($trusted_urls_file,"r");
195
				$ouvre=fopen($trusted_urls_file,"r");
157
				if ($ouvre)
196
				if ($ouvre)
158
			       		{
197
			       		{
159
					while (!feof ($ouvre))
198
					while (!feof ($ouvre))
160
						{
199
						{
161
						$tampon = fgets($ouvre, 4096);
200
						$tampon = fgets($ouvre, 4096);
162
						$url_list_l = substr($tampon,11);
201
						$url_list_l = substr($tampon,11);
163
						$url_list = trim ($url_list_l,"\"\n\t ");
202
						$url_list = trim ($url_list_l,"\"\n\t ");
164
						$tab_urls = explode (",", $url_list);
203
						$tab_urls = explode (",", $url_list);
165
						foreach ($tab_urls as $url ){
204
						foreach ($tab_urls as $url ){
166
							if ($url) echo $url."\n";
205
							if ($url) echo $url."\n";
167
							}
206
							}
168
						}
207
						}
169
					}
208
					}
170
				else	{
209
				else	{
171
					echo "failed to open $trusted_urls_file";
210
					echo "failed to open $trusted_urls_file";
172
					}
211
					}
173
				fclose($ouvre);
212
				fclose($ouvre);
174
				echo "</textarea>";
213
				echo "</textarea>";
175
			?>
214
			?>
176
		</td></tr>
215
		</td></tr>
177
		</TABLE>
216
		</TABLE>
178
		<input type='hidden' name='choix' value='MAJ_UAMALLOWED'>
217
		<input type='hidden' name='choix' value='MAJ_UAMALLOWED'>
179
		<input type='submit' value='<?php echo $l_submit ;?>'>
218
		<input type='submit' value='<?php echo $l_submit ;?>'>
180
		</FORM>
219
		</FORM>
181
	</td></tr>
220
	</td></tr>
182
	</TABLE>
221
	</TABLE>
183
</TABLE>
222
</TABLE>
184
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
223
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
185
	<tr><th><?php echo $l_trusted_mac ;?></th></tr>
224
	<tr><th><?php echo $l_trusted_mac ;?></th></tr>
186
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
225
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
187
</TABLE>
226
</TABLE>
188
 
227
 
189
<table width="100%" border=1 cellspacing=0 cellpadding=1>
228
<table width="100%" border=1 cellspacing=0 cellpadding=1>
190
<tr><td colspan=2 align="center">
229
<tr><td colspan=2 align="center">
191
<?
230
<?
192
echo "$l_trusted_mac_explain</td></tr>";
231
echo "$l_trusted_mac_explain</td></tr>";
193
echo "<tr><td align='center' valign='middle'>";
232
echo "<tr><td align='center' valign='middle'>";
194
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";
233
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";
195
echo "<table cellspacing=2 cellpadding=3 border=1>";
234
echo "<table cellspacing=2 cellpadding=3 border=1>";
196
echo "<tr><th>$l_trusted_mac_address<th>$l_trusted_mac_info<th>$l_trusted_mac_del</tr>";
235
echo "<tr><th>$l_trusted_mac_address<th>$l_trusted_mac_info<th>$l_trusted_mac_del</tr>";
197
// On lit et on interprète le fichier de filtrage de protocoles
236
// On lit et on affiche le fichier d'exception
198
$trusted_mac_file="/usr/local/etc/alcasar-macallowed";
237
$display_form = true;
199
if (file_exists($trusted_mac_file))
238
if (is_file ($mac_allowed_list))
200
	{
239
	{
201
	$pointeur=fopen($trusted_mac_file,"r");
240
	$tab=file($mac_allowed_list);
202
	while (!feof ($pointeur))
241
	if ($tab)  # le fichier n'est pas vide
203
		{
242
		{
204
		$ligne=fgets($pointeur, 4096);
-
 
205
		if ($ligne)
243
		foreach ($tab as $line)
206
			{
244
			{
207
			$field=explode(" ", $ligne);
245
			$field=explode("#", $line);
-
 
246
			$mac_addr=trim(trim($field[0],"macallowed="));
208
			$mac_info=trim($field[2],"#");
247
			$mac_info=trim($field[1],"#");
209
			echo "<tr><td>$field[1]";
248
			echo "<tr><td>$mac_addr";
210
			echo "<td>$mac_info";
249
			echo "<td>$mac_info";
211
			echo "<td><input type='checkbox' name='del-$field[1]'>";
250
			echo "<td><input type='checkbox' name='$mac_addr'>";
212
			echo "</tr>";
251
			echo "</tr>";
213
			}
252
			}
214
		}
253
		}
215
	fclose($pointeur);
254
	else { $display_form = false;}
216
	}
255
	}
217
else	{
256
else	{
218
	echo "$l_error_open_file $trusted_mac_file";
257
	echo "$l_error_open_file $mac_allowed_list";
-
 
258
	$display_form = false;
219
	}
259
	}
-
 
260
echo "</table>";
-
 
261
if ($display_form)
-
 
262
	{
-
 
263
	echo "<input type='hidden' name='choix' value='del_mac'>";
-
 
264
	echo "<input type='submit' value='$l_submit'>";
-
 
265
	}
-
 
266
echo "</form></td><td valign='middle' align='center'>";
-
 
267
echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";
-
 
268
echo "<table cellspacing=2 cellpadding=3 border=1>";
-
 
269
echo "<tr><th>$l_trusted_mac_address<th>$l_trusted_mac_info";
220
?>
270
?>
221
</table>
271
<td></td></tr>
222
<input type='hidden' name='choix' value='change'>
-
 
223
<input type='submit' value='<?echo"$l_submit";?>'>
-
 
224
</form>
-
 
225
</td>
-
 
226
<td valign='middle' align='center'>
-
 
227
<form action='net_filter.php' method='POST'>
-
 
228
<table cellspacing=2 cellpadding=3 border=1>
-
 
229
<tr><th><?echo"$l_trusted_mac_address<th>$l_trusted_mac_info";?></tr>
272
<tr><td>exemple : 12-2f-36-a4-df-43</td><td>exemple : PC of the boss</td><td></td></tr>
230
<tr><td><input type='text' name='add_proto' size='10'></td>
273
<tr><td><input type='text' name='add_mac' size='17'></td>
231
<td><input type='text' name='add_port' size='5'></td>
274
<td><input type='text' name='add_comment' size='10'></td>
232
<input type='hidden' name='choix' value='new_proto'>
275
<input type='hidden' name='choix' value='new_mac'>
233
<td><input type='submit' value='<?echo"$l_add_to_list";?>'></td>
276
<td><input type='submit' value='<?echo"$l_add_to_list";?>'></td>
234
</tr></table>
277
</tr></table>
235
</form>
278
</form>
236
</td></tr>
279
</td></tr>
237
</table>
280
</table>
238
 
-
 
239
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
-
 
240
	<tr bgcolor="#666666"><td>
-
 
241
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
-
 
242
		<tr><td valign="middle" align="left">
-
 
243
		<center><?php
-
 
244
		echo "$l_trusted_mac_explain1 <BR>";
-
 
245
		echo "$l_trusted_mac_explain2";
-
 
246
		echo "<FORM action='$_SERVER[PHP_SELF]' method='POST'>";?>
-
 
247
		<TABLE cellspacing=2 cellpadding=3 border=1>
-
 
248
		<tr><td width=60% height=100% align=center>
-
 
249
			<H3><?php echo $l_trusted_mac_list ;?></H3>
-
 
250
			exemple : 12-2f-36-a4-df-43<BR>
-
 
251
			<?php
-
 
252
				echo "<textarea name='trusted_macs' rows=5 cols=40>";
-
 
253
				$trusted_macs_file="/usr/local/etc/alcasar-macallowed";
-
 
254
				$ouvre=fopen($trusted_macs_file,"r");
-
 
255
				if ($ouvre)
-
 
256
					{
-
 
257
					while (!feof ($ouvre))
-
 
258
						{
-
 
259
						$tampon = fgets($ouvre, 4096);
-
 
260
						$mac_list_l = substr($tampon,11);
-
 
261
						$mac_list = trim ($mac_list_l,"\"\n\t ");
-
 
262
						$tab_macs = explode (",", $mac_list);
-
 
263
						foreach ($tab_macs as $macs ){
-
 
264
							if ($macs) echo $macs."\n";
-
 
265
							}
-
 
266
		  				}
-
 
267
					}
-
 
268
				else	{
-
 
269
					echo "failed to open $trusted_macs_file";
-
 
270
					}
-
 
271
				fclose($ouvre);
-
 
272
				echo "</textarea>";
-
 
273
			?>
-
 
274
		</td></tr>
-
 
275
		</TABLE>
-
 
276
		<input type='hidden' name='choix' value='MAJ_MACALLOWED'>
-
 
277
		<input type='submit' value='<?php echo $l_submit ;?>'>
-
 
278
		</FORM>
-
 
279
	</td></tr>
-
 
280
</TABLE>
-
 
281
</BODY>
281
</BODY>
282
</HTML>
282
</HTML>
283
 
283