Subversion Repositories ALCASAR

Rev

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

Rev 520 Rev 612
Line 6... Line 6...
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
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
9
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
10
<?
10
<?
11
$services_list="/usr/local/etc/alcasar-services";
-
 
12
# Choice of language
11
# Choice of language
13
$Language = 'en';
12
$Language = 'en';
14
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
13
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
15
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
14
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
16
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
15
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
Line 54... Line 53...
54
  $l_enabled="Enable";
53
  $l_enabled="Enable";
55
  $l_delete="Delete from list";
54
  $l_delete="Delete from list";
56
  $l_add_to_list="Add to the list";
55
  $l_add_to_list="Add to the list";
57
  $l_save_modif="Save modifications";
56
  $l_save_modif="Save modifications";
58
}
57
}
59
echo "
-
 
60
<tr><th>$l_title_antivir</th></tr>
58
$services_list="/usr/local/etc/alcasar-services";
61
<tr bgcolor=\"#FFCC66\"><td><img src=\"/images/pix.gif\" width=1 height=2></td></tr>
59
$conf_file="/usr/local/etc/alcasar.conf";
62
</TABLE>";
-
 
63
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
60
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
64
switch ($choix)
61
switch ($choix)
65
{
62
{
66
case 'AV_On' :
63
case 'AV_On' :
67
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -on");
64
	exec ("sudo /usr/local/sbin/alcasar-havp.sh -on");
Line 145... Line 142...
145
		}
142
		}
146
	else {echo "$l_error_open_file $services_list";}
143
	else {echo "$l_error_open_file $services_list";}
147
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
144
	exec ("sudo /usr/local/sbin/alcasar-nf.sh -on");
148
	break;
145
	break;
149
	}
146
	}
150
?>
-
 
151
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
-
 
152
	<tr><td valign="middle" align="left">
147
# default values
153
<?php
-
 
154
$pointeur = fopen("/etc/dansguardian/dansguardian.conf", "r");
-
 
155
$antivir_filter = false; $DG_filter = false; $out=0;
-
 
156
if ($pointeur)
148
if (is_file ($conf_file))
157
	{
149
	{
158
  	while (!feof($pointeur))
150
	$tab=file($conf_file);
-
 
151
	if ($tab)
159
		{
152
		{
160
    		$ligne = fgets($pointeur);
153
		foreach ($tab as $line)
161
    		if (preg_match("/^proxyport = 8090/", $ligne, $r))
-
 
162
			{
154
			{
163
			$antivir_filter = true;
155
			$field=explode("=", $line);
-
 
156
			if ($field[0] == "PROTOCOLS_FILTERING")	{$PROTOCOLS_FILTERING=trim($field[1]);}
164
			$out++;
157
			if ($field[0] == "WEB_ANTIVIRUS")	{$WEB_ANTIVIRUS=trim($field[1]);}
165
			}
158
			}
166
    		if (preg_match("/^reportinglevel = 3/", $ligne, $r)) // non utilisé mais on garde pour l'exemple
-
 
167
			{
159
		}
-
 
160
	}
168
			$DG_filter = true;
161
else { echo "$l_error_open_file $conf_file";}
169
			$out++;
162
echo "<tr><th>$l_title_antivir</th></tr>";
170
			}
163
?>
171
		if ($out == 2) break;
164
<tr bgcolor=#FFCC66><td><img src=/images/pix.gif width=1 height=2></td></tr>
172
    		}
165
</TABLE>
-
 
166
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
-
 
167
	<tr><td valign="middle" align="left">
173
  	}
168
<?php
174
fclose($pointeur);
-
 
175
if ($antivir_filter)
169
if ($WEB_ANTIVIRUS == "on")
176
	{
170
	{
177
	echo "<CENTER><H3>$l_antivir_on</H3></CENTER>";
171
	echo "<CENTER><H3>$l_antivir_on</H3></CENTER>";
178
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
172
 	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
179
	echo "<input type=hidden name='choix' value=\"AV_Off\">";
173
	echo "<input type=hidden name='choix' value=\"AV_Off\">";
180
	echo "<input type=submit value=\"$l_switch_antivir_off\">";
174
	echo "<input type=submit value=\"$l_switch_antivir_off\">";
Line 195... Line 189...
195
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
189
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
196
</table>
190
</table>
197
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
191
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
198
<tr><td valign="middle" align="left">
192
<tr><td valign="middle" align="left">
199
<?
193
<?
200
$pointeur = fopen("/usr/local/bin/alcasar-iptables.sh", "r");
-
 
201
$result = False ;
-
 
202
if ($pointeur)
-
 
203
	{
-
 
204
  	while (!feof($pointeur))
-
 
205
		{
-
 
206
    		$ligne = fgets($pointeur);
-
 
207
    		if (preg_match('/^PROTO_FILTERING="yes"/', $ligne, $r))
194
if ($PROTOCOLS_FILTERING == "on")
208
			{
-
 
209
			$result = True ;
-
 
210
			break;
-
 
211
			}
-
 
212
    		}
-
 
213
  	}
-
 
214
fclose($pointeur);
-
 
215
if ($result)
-
 
216
	{
195
	{
217
	echo "<CENTER><H3>$l_netfilter_on</H3>$l_comment_on</CENTER>";
196
	echo "<CENTER><H3>$l_netfilter_on</H3>$l_comment_on</CENTER>";
218
	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
197
	echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
219
	echo "<input type=hidden name='choix' value=\"NF_Off\">";
198
	echo "<input type=hidden name='choix' value=\"NF_Off\">";
220
	echo "<input type=submit value=\"$l_switch_off\">";
199
	echo "<input type=submit value=\"$l_switch_off\">";
Line 227... Line 206...
227
	echo "<input type=submit value=\"$l_switch_on\">";
206
	echo "<input type=submit value=\"$l_switch_on\">";
228
	}
207
	}
229
echo "</FORM>";
208
echo "</FORM>";
230
echo "</td></tr>";
209
echo "</td></tr>";
231
echo "</TABLE>";
210
echo "</TABLE>";
232
if ($result) require ('net_filter2.php');
211
if ($PROTOCOLS_FILTERING == "on") require ('net_filter2.php');
233
?>
212
?>
234
</BODY>
213
</BODY>
235
</HTML>
214
</HTML>