Subversion Repositories ALCASAR

Rev

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

Rev 303 Rev 305
Line 13... Line 13...
13
$Language = 'en';
13
$Language = 'en';
14
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
14
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
15
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
15
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
16
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
16
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
17
if($Language == 'fr'){
17
if($Language == 'fr'){
18
  $l_title = "Filtrage réseau";
18
  $l_title = "Filtrage de protocoles réseau";
-
 
19
  $l_antivir_on="L'antivirus de flux WEB est actuellement activé";
-
 
20
  $l_antivir_off="L'antivirus de flux WEB est actuellement désactivé";
-
 
21
  $l_switch_antivir_on="Activer l'antivirus";
-
 
22
  $l_switch_antivir_off="Désactiver l'antivirus";
19
  $l_netfilter_on="Le filtrage réseau est actuellement activé";
23
  $l_netfilter_on="Le filtrage réseau est actuellement activé";
20
  $l_netfilter_off="Le filtrage réseau est actuellement désactivé";
24
  $l_netfilter_off="Le filtrage réseau est actuellement désactivé";
21
  $l_switch_on="Activer le filtrage réseau";
25
  $l_switch_on="Activer le filtrage réseau";
22
  $l_switch_off="Désactiver le filtrage réseau";
26
  $l_switch_off="Désactiver le filtrage réseau";
23
  $l_comment_on="&Agrave; l'exclusion du WEB (port 80), les protocoles r&eacute;seau sont interdits.<BR>Choisissez ci-dessous les protocoles que vous autorisez";
27
  $l_comment_on="&Agrave; l'exclusion du WEB (port 80), les protocoles r&eacute;seau sont interdits.<BR>Choisissez ci-dessous les protocoles que vous autorisez";
Line 29... Line 33...
29
  $l_delete="Supprimer de la liste";
33
  $l_delete="Supprimer de la liste";
30
  $l_add_to_list="Ajouter &agrave; la liste";
34
  $l_add_to_list="Ajouter &agrave; la liste";
31
  $l_save_modif="Enregistrer les modifications";
35
  $l_save_modif="Enregistrer les modifications";
32
}
36
}
33
else {
37
else {
34
  $l_title = "Network Filter";
38
  $l_title = "Network protocols filtering";
-
 
39
  $l_antivir_on="Actually, the antivirus is on";
-
 
40
  $l_antivir_off="Actually, the antivirus is off";
-
 
41
  $l_switch_antivir_on="Switch the antivirus on";
-
 
42
  $l_switch_antivir_off="Switch the antivirus off";
35
  $l_netfilter_on="Actually, the network filter is enable";
43
  $l_netfilter_on="Actually, the network filter is enable";
36
  $l_netfilter_off="Actually, the network filter is disable";
44
  $l_netfilter_off="Actually, the network filter is disable";
37
  $l_switch_on="Switch the Network Filter on";
45
  $l_switch_on="Switch the Network Filter on";
38
  $l_switch_off="Switch the Network Filter off";
46
  $l_switch_off="Switch the Network Filter off";
39
  $l_comment_on="(choose the authorized network protocols)";
47
  $l_comment_on="(choose the authorized network protocols)";
Line 59... Line 67...
59
case 'AV_Off' :
67
case 'AV_Off' :
60
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -off");
68
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -off");
61
	break;
69
	break;
62
case 'NF_On' :
70
case 'NF_On' :
63
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
71
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
64
break;
72
	break;
65
case 'NF_Off' :
73
case 'NF_Off' :
66
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -off");
74
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -off");
67
break;
75
	break;
68
case 'new_proto' :
76
case 'new_proto' :
69
	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'])))
70
		{
78
		{
71
		$tab=file($services_list);
79
		$tab=file($services_list);
72
		if ($tab)
80
		if ($tab)
Line 89... Line 97...
89
				exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
97
				exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
90
				}
98
				}
91
			}
99
			}
92
		else {echo "$l_error_open_file $services_list";}
100
		else {echo "$l_error_open_file $services_list";}
93
		}
101
		}
94
break;
102
	break;
95
case 'change' :
103
case 'change' :
96
	$tab=file($services_list);
104
	$tab=file($services_list);
97
	if ($tab)
105
	if ($tab)
98
		{
106
		{
99
//on active|désactive les protocoles
107
//on active|désactive les protocoles
Line 133... Line 141...
133
			}
141
			}
134
		fclose($pointeur);
142
		fclose($pointeur);
135
		}
143
		}
136
	else {echo "$l_error_open_file $services_list";}
144
	else {echo "$l_error_open_file $services_list";}
137
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
145
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
138
break;
146
	break;
139
	}
147
	}
140
?>
148
?>
141
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
-
 
142
<tr><th><?php echo "$l_title1"; ?></th></tr>
-
 
143
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
-
 
144
</TABLE>
-
 
145
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
149
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
146
	<tr><td valign="middle" align="left">
150
	<tr><td valign="middle" align="left">
147
<?php
151
<?php
148
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
152
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
149
$result_antivir = false; $result_filter = false; $out=0;
153
$result_antivir = false; $result_filter = false; $out=0;
Line 182... Line 186...
182
	}
186
	}
183
?>
187
?>
184
</FORM>
188
</FORM>
185
</td></tr>
189
</td></tr>
186
</TABLE>
190
</TABLE>
187
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>";
191
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
188
<tr><td valign="middle" align="left">";
192
<tr><td valign="middle" align="left">
189
<?
193
<?
190
$pointeur = fopen("/usr/local/bin/alcasar-iptables.sh", "r");
194
$pointeur = fopen("/usr/local/bin/alcasar-iptables.sh", "r");
191
$result = False ;
195
$result = False ;
192
if ($pointeur)
196
if ($pointeur)
193
	{
197
	{