Subversion Repositories ALCASAR

Rev

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

Rev 1827 Rev 2006
Line 14... Line 14...
14
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
14
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
15
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
15
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
16
if($Language == 'fr'){
16
if($Language == 'fr'){
17
  $l_remove="Retirer de la liste";
17
  $l_remove="Retirer de la liste";
18
  $l_title_proto = "Filtrage de protocoles réseau";
18
  $l_title_proto = "Filtrage de protocoles réseau";
19
  $l_protocolsfilter_on="Le filtrage de protocoles réseau est actuellement activé";
19
  $l_protocolsfilter="Vous pouvez personnaliser le profile de filtrage protocole 'personnalisable' ici. Vous pouvez ensuite l'attribuer à des utilisateurs via l'éditeur ou la création d'utilisateur.";
20
  $l_protocolsfilter_off="Le filtrage de protocoles réseau est actuellement désactiv&eacute";
-
 
21
  $l_switch_on="Activer le filtrage";
-
 
22
  $l_switch_off="Désactiver le filtrage";
-
 
23
  $l_comment_on="&Agrave; l'exclusion du WEB (port 80), les protocoles r&eacute;seaux sont interdits.<BR>Choisissez ci-dessous les protocoles que vous autorisez";
20
  $l_comment_on="&Agrave; l'exclusion du WEB (port 80), les protocoles r&eacute;seaux sont interdits.<BR>Choisissez ci-dessous les protocoles que vous autorisez";
24
  $l_comment_off="(tous les protocoles réseau sont autoris&eacute;s)";
21
  $l_comment_off="(tous les protocoles réseau sont autoris&eacute;s)";
25
  $l_protocols="Protocoles autoris&eacute;s";
22
  $l_protocols="Protocoles autoris&eacute;s";
26
  $l_error_open_file="Erreur d'ouverture du fichier";
23
  $l_error_open_file="Erreur d'ouverture du fichier";
27
  $l_port="Numéro de port";
24
  $l_port="Numéro de port";
Line 31... Line 28...
31
  $l_save="Enregistrer les modifications";
28
  $l_save="Enregistrer les modifications";
32
}
29
}
33
else {
30
else {
34
  $l_remove="Remove from list";
31
  $l_remove="Remove from list";
35
  $l_title_proto = "Network protocols filter";
32
  $l_title_proto = "Network protocols filter";
36
  $l_protocolsfilter_on="Actually, the network protocols filter is enable";
-
 
37
  $l_protocolsfilter_off="Actually, the network protocols filter is disable";
33
  $l_protocolsfilter="You can change your \"custom\" protocol filtering here. You can set it to a user from ACC (create user / edit user)";
38
  $l_switch_on="Switch the Filter on";
-
 
39
  $l_switch_off="Switch the Filter off";
-
 
40
  $l_comment_on="(choose the authorized network protocols)";
34
  $l_comment_on="(choose the authorized network protocols)";
41
  $l_comment_on="Except for the WEB (port 80), all protocols are blocked.<BR>Choose in the list below, the protocols you want authorize";
35
  $l_comment_on="Except for the WEB (port 80), all protocols are blocked.<BR>Choose in the list below, the protocols you want authorize";
42
  $l_comment_off="(all the network protocols are allowed for authenticated users)";
36
  $l_comment_off="(all the network protocols are allowed for authenticated users)";
43
  $l_protocols="Authorize protocols";
37
  $l_protocols="Authorize protocols";
44
  $l_error_open_file="Error opening the file";
38
  $l_error_open_file="Error opening the file";
Line 77... Line 71...
77
}
71
}
78
 
72
 
79
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
73
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
80
switch ($choix)
74
switch ($choix)
81
{
75
{
82
case 'NF_On' :
-
 
83
	exec ("sudo /usr/local/bin/alcasar-nf.sh -on");
-
 
84
	break;
-
 
85
case 'NF_Off' :
-
 
86
	exec ("sudo /usr/local/bin/alcasar-nf.sh -off");
-
 
87
	break;
-
 
88
case 'new_port' :
76
case 'new_port' :
89
	if ((trim($_POST['add_port']) != "80") and ($_POST['add_port'] != "") and ($_POST['add_proto'] != "") and (is_numeric($_POST['add_port'])))
77
	if ((trim($_POST['add_port']) != "80") and ($_POST['add_port'] != "") and ($_POST['add_proto'] != "") and (is_numeric($_POST['add_port'])))
90
		{
78
		{
91
		$_POST['add_proto'] = str_replace (CHR(32),"-",$_POST['add_proto']);
79
		$_POST['add_proto'] = str_replace (CHR(32),"-",$_POST['add_proto']);
92
		$tab=file(SERVICES_LIST);
80
		$tab=file(SERVICES_LIST);
Line 150... Line 138...
150
		fclose($pointeur);
138
		fclose($pointeur);
151
		}
139
		}
152
	exec ("sudo /usr/local/bin/alcasar-iptables.sh -on");
140
	exec ("sudo /usr/local/bin/alcasar-iptables.sh -on");
153
	break;
141
	break;
154
	}
142
	}
155
# default values
-
 
156
if (is_file (CONF_FILE))
-
 
157
	{
-
 
158
	$tab=file(CONF_FILE);
-
 
159
	if ($tab)
-
 
160
		{
-
 
161
		foreach ($tab as $line)
-
 
162
			{
-
 
163
			$field=explode("=", $line);
-
 
164
			if ($field[0] == "PROTOCOLS_FILTERING")	{$PROTOCOLS_FILTERING=trim($field[1]);}
-
 
165
			}
-
 
166
		}
-
 
167
	}
-
 
168
?>
143
?>
169
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
144
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
170
<tr><th><?echo "$l_title_proto";?></th></tr>
145
<tr><th><?echo "$l_title_proto";?></th></tr>
171
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
146
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
172
</table>
147
</table>
173
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
148
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
174
<tr>
149
<tr>
-
 
150
 
175
<?
151
<?
176
if ($PROTOCOLS_FILTERING == "on")
-
 
177
	{
152
 
178
	echo "<td colspan=\"2\" valign=\"middle\" align=\"left\">";
153
echo "<td colspan=\"2\" valign=\"middle\" align=\"left\">";
179
	echo "<CENTER><H3>$l_protocolsfilter_on</H3>$l_comment_on</CENTER>";
154
echo "<CENTER><H3>$l_protocolsfilter_on</H3>$l_comment_on</CENTER>";
180
	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
-
 
181
	echo "<input type=hidden name='choix' value=\"NF_Off\">";
-
 
182
	echo "<input type=submit value=\"$l_switch_off\">";
-
 
183
	echo "</FORM></td></tr>";
-
 
184
	require ('protocols_filter2.php');
155
require ('protocols_filter2.php');
185
	}
-
 
186
else
-
 
187
	{
-
 
188
	echo "<td valign=\"middle\" align=\"left\">";
-
 
189
	echo "<CENTER><H3>$l_protocolsfilter_off</H3>$l_comment_off</CENTER>";
-
 
190
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
-
 
191
	echo "<input type=hidden name='choix' value=\"NF_On\">";
-
 
192
	echo "<input type=submit value=\"$l_switch_on\">";
-
 
193
	echo "</FORM></td></tr>";
-
 
194
	echo "</table></body></html>";
-
 
195
	}
156
 
196
?>
157
?>
-
 
158