Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1041 → Rev 1034

/web/acc/admin/bl_filter.php
21,16 → 21,15
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'fr'){
$l_title1="Filtrage de noms de domaine et d'URL";
$l_title1 = "Filtrage de noms de domaine et d'URL";
$l_error_open_file="Erreur d'ouverture du fichier";
$l_dnsfilter_on="Le filtrage de noms de domaine et d'URL est actuellement activé";
$l_dnsfilter_off="Le filtrage de noms de domaine et d'URL est actuellement désactivé";
$l_switch_filtering_on="Activer le filtrage";
$l_switch_filtering_off="Désactiver le filtrage";
$l_bl="Liste noire";
$l_wl="Liste blanche";
$l_list_version="Version de la liste : ";
$l_bl_categories="Sélectionnez les catégories à filtrer";
$l_wl_categories="Sélectionnez les catégories à autoriser";
$l_main_bl="Liste noire";
$l_bl_version="Version actuelle :";
$l_bl_categories="Choix des catégories à filtrer";
$l_download_bl="Télécharger la dernière version";
$l_fingerprint="L'empreinte numérique du fichier téléchargé est : ";
$l_fingerprint2="Vérifiez-là en suivant ce lien (ligne 'blacklists.tar.gz') : ";
40,16 → 39,13
$l_specific_filtering="Filtrage special";
$l_forbidden_dns="Noms de domaine filtrés";
$l_forbidden_dns_explain="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
$l_allowed_dns="Noms de domaine autorisés";
$l_one_dns="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
$l_maj_rehabilitated="Noms de domaine ou URLs réhabilités";
$l_rehabilitated_dns="Noms de domaine réhabilités";
$l_rehabilitated_dns_explain="Entrez ici des noms de domaine bloqués par la liste noire <BR> que vous souhaitez réhabiliter.";
$l_add_to_bl="Noms de domaine ou URLs ajoutés à la liste noire";
$l_add_to_wl="Noms de domaine ou URLs ajoutés à la liste blanche";
$l_forbidden_url="URL filtrés";
$l_forbidden_url_explain="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)";
$l_allowed_url="URL authorisés";
$l_rehabilitated_url="URL réhabilités";
$l_rehabilitated_url_explain="Entrez ici des URL bloquées par la liste noire <BR> que vous souhaitez réhabiliter.";
$l_one_url="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)";
61,16 → 57,15
$l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>lien pour créer un identifiant Youtube (Id)</a>)";
}
else {
$l_title1="Domain names and URL filtering";
$l_title1 = "Domain names and URL filtering";
$l_error_open_file="Error opening the file";
$l_dnsfilter_on="Actually, the Domain name and URL filter is on";
$l_dnsfilter_off="Actually, the Domain name and URL filter is off";
$l_switch_filtering_on="Switch the Filter on";
$l_switch_filtering_off="Switch the Filter off";
$l_bl="BlackList";
$l_wl="WhiteList";
$l_list_version="List version : ";
$l_bl_categories="Select the categories to filter";
$l_wl_categories="Select the categories to allow";
$l_main_bl="Blacklist";
$l_bl_version="Current version : ";
$l_bl_categories="Choice of filtered categories";
$l_download_bl="Download the last version";
$l_fingerprint="The digital fingerprint of the downloaded blacklist is : ";
$l_fingerprint2="Verify it with this link (line 'blacklists.tar.gz') : ";
80,16 → 75,13
$l_specific_filtering="Specific filtering";
$l_forbidden_dns="Filtered domain names";
$l_forbidden_dns_explain="Enter one domain name per row (exemple : .domain.org)";
$l_allowed_dns="Allowed domain names";
$l_one_dns="Enter one domain name per row (example : .domain.org)";
$l_maj_rehabilitated="Domain names or URLs rehabilitated";
$l_rehabilitated_dns="Rehabilitated domain names";
$l_rehabilitated_dns_explain="Enter here domain names that are blocked by the blacklist <BR> and you want to rehabilitate.";
$l_add_to_bl="Domain names or URLs to add to blacklist";
$l_add_to_wl="Domain names or URLs to add to whitelist";
$l_forbidden_url="Filtered URL";
$l_forbidden_url_explain="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
$l_allowed_url="Allowed URL";
$l_rehabilitated_url="Rehabilitated URL";
$l_rehabilitated_url_explain="Enter here URL that are blocked by the blacklist <BR> and you want to rehabilitate.";
$l_one_url="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
100,16 → 92,12
$l_safe_youtube="For Youtube, enter your ID here : ";
$l_youtube_id="(<a href='http://www.youtube.com/education_signup' target='cat_help' onclick=window.open('http://www.youtube.com/education_signup','cat_help','width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes') title='Youtube for school'>link to create a Youtube Id</a>)";
}
$dir_etc="/usr/local/etc/";
$dir_dg="/etc/dansguardian/lists/";
$bl_categories=$dir_etc."alcasar-bl-categories";
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
$wl_categories=$dir_etc."alcasar-wl-categories";
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
$conf_file=$dir_etc."alcasar.conf";
$dir_blacklist=$dir_dg."blacklist/";
$urlregex_file=$dir_dg."urlregexplist";
$bannedsite_file=$dir_dg."bannedsitelist";
$bl_categories="/usr/local/etc/alcasar-bl-categories";
$bl_categories_enabled="/usr/local/etc/alcasar-bl-categories-enabled";
$dir_blacklist="/etc/dansguardian/lists/blacklist/";
$conf_file="/usr/local/etc/alcasar.conf";
$urlregex_file="/etc/dansguardian/lists/urlregexplist";
$bannedsite_file="/etc/dansguardian/lists/bannedsitelist";
$dir_tmp="/tmp/blacklists";
# default values
if (is_file ($conf_file))
137,17 → 125,17
exec ("sudo /usr/local/sbin/alcasar-bl.sh --off");
$DNS_FILTERING="off";
break;
case 'Download_list' :
case 'Download_bl' :
exec ("sudo /usr/local/sbin/alcasar-bl.sh --download");
break;
case 'Active_list' :
case 'Active_bl' :
exec ("sudo /usr/local/sbin/alcasar-bl.sh --adapt");
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
break;
case 'Reject_list' :
case 'Reject_bl' :
unlink ("$dir_tmp/blacklists.tar.gz"); unlink ("$dir_tmp/md5sum");
break;
case 'MAJ_cat_bl' :
case 'MAJ_cat' :
$tab=file($bl_categories_enabled);
if ($tab)
{
163,48 → 151,23
fclose($pointeur);
}
else {echo "$l_error_open_file $bl_categories_enabled";}
$fichier=fopen($dir_dg."blacklists/ossi/domains","w+");
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
fputs($fichier, form_filter($_POST['OSSI_bl_domains']));
fclose($fichier);
unset($_POST['OSSI_bl_domains']);
$fichier=fopen($dir_dg."exceptionsitelist","w+");
fputs($fichier, form_filter($_POST['BL_rehabilited_domains']));
$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
fputs($fichier, form_filter($_POST['OSSI_wl_domains']));
fclose($fichier);
unset($_POST['BL_rehabilited_domains']);
$fichier=fopen($dir_dg."blacklists/ossi/urls","w+");
unset($_POST['OSSI_wl_domains']);
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
fputs($fichier, form_filter($_POST['OSSI_bl_urls']));
fclose($fichier);
unset($_POST['OSSI_bl_urls']);
$fichier=fopen($dir_dg."exceptionurllist","w+");
fputs($fichier, form_filter($_POST['BL_rehabilited_urls']));
fclose($fichier);
unset($_POST['BL_rehabilited_urls']);
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
break;
case 'MAJ_cat_wl' :
$tab=file($wl_categories_enabled);
if ($tab)
{
$pointeur=fopen($wl_categories_enabled, "w+");
foreach ($_POST as $key => $value)
{
if (strstr($key,'chk-'))
{
$line=str_replace('chk-','',$key)."\n";
fwrite($pointeur,$line);
}
}
fclose($pointeur);
}
else {echo "$l_error_open_file $wl_categories_enabled";}
$fichier=fopen($dir_dg."blacklists/ossi/domains_wl","w+");
fputs($fichier, form_filter($_POST['OSSI_wl_domains']));
fclose($fichier);
unset($_POST['OSSI_wl_domains']);
$fichier=fopen($dir_dg."blacklists/ossi/urls_wl","w+");
$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
fputs($fichier, form_filter($_POST['OSSI_wl_urls']));
fclose($fichier);
unset($_POST['OSSI_wl_urls']);
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
break;
case 'Specific_filtering' :
$pureip="-pureip_off"; $safesearch="-safesearch_off"; ;
/web/acc/admin/bl_filter2.php
13,14 → 13,12
}
else
{
echo "$filename doesn't exist";
echo "$l_error_openfile $filename";
}
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>
<?php echo $l_list_version; echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));?>
</th></tr>
<tr><th><?php echo $l_main_bl; ?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</table>
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
27,19 → 25,22
<tr><td valign="middle" align="left" colspan=10>
<FORM action='bl_filter.php' method=POST>
<?php
echo "<center>$l_bl_version";
echo date ("F d Y", filemtime ('/etc/dansguardian/lists/blacklists/README'));
echo "</center><BR>";
if ((file_exists("$dir_tmp/blacklists.tar.gz")) && (file_exists("$dir_tmp/md5sum")))
{
echo "$l_fingerprint"; echo_file ("$dir_tmp/md5sum");
echo "<br>$l_fingerprint2<a href='http://dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST' target='cat_help' onclick=window.open('http://dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST','cat_help','width=600,height=150,toolbar=no,scrollbars=yes,resizable=yes') title='verify fingerprint'>dsi.ut-capitole.fr/blacklists/download/MD5SUM.LST</a><br>";
echo "<input type='hidden' name='choix' value='Active_list'>";
echo "<input type='hidden' name='choix' value='Active_bl'>";
echo "<input type='submit' value='$l_activate_bl'> ($l_warning)</FORM>";
echo "<FORM action='bl_filter.php' method=POST>";
echo "<input type='hidden' name='choix' value='Reject_list'>";
echo "<input type='hidden' name='choix' value='Reject_bl'>";
echo "<input type='submit' value='$l_reject_bl'></form>";
}
else
{
echo "<input type='hidden' name='choix' value='Download_list'>";
echo "<input type='hidden' name='choix' value='Download_bl'>";
echo "<input type='submit' value='$l_download_bl'>";
echo " ($l_warning)";
}
46,15 → 47,9
?>
</FORM>
</td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th><?php echo $l_bl; ?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</table>
<table width="100%" border=1 cellspacing=0 cellpadding=1>
<tr><td valign="middle" align="left" colspan=10>
<FORM action='bl_filter.php' method=POST>
<input type='hidden' name='choix' value='MAJ_cat_bl'>
<input type='hidden' name='choix' value='MAJ_cat'>
<?php
echo "<center>$l_bl_categories</center></td></tr>";
//on lit et on interprete le fichier de catégories
91,25 → 86,25
echo "<center><b>$l_maj_rehabilitated</b></center></td></tr>";
echo "<tr><td colspan=5 align=center>";
echo "<H3>$l_rehabilitated_dns</H3>$l_rehabilitated_dns_explain<BR>$l_one_dns<BR>";
echo "<textarea name='BL_rehabilited_domains' rows=3 cols=40>";
echo_file ($dir_dg."exceptionsitelist");
echo "<textarea name='OSSI_wl_domains' rows=5 cols=40>";
echo_file ("/etc/dansguardian/lists/exceptionsitelist");
echo "</textarea></td>";
echo "<td colspan=5 align=center>";
echo "<H3>$l_rehabilitated_url</H3>$l_rehabilitated_url_explain<BR>$l_one_url<BR>";
echo "<textarea name='BL_rehabilited_urls' rows=3 cols=40>";
echo_file ($dir_dg."exceptionurllist");
echo "<textarea name='OSSI_wl_urls' rows=5 cols=40>";
echo_file ("/etc/dansguardian/lists/exceptionurllist");
echo "</textarea></td></tr><tr><td colspan=10>";
echo "<tr><td valign='middle' align='left' colspan=10>";
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
echo "<tr><td colspan=5 align=center>";
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
echo "<textarea name='OSSI_bl_domains' rows=3 cols=40>";
echo_file ($dir_dg."blacklists/ossi/domains");
echo "<textarea name='OSSI_bl_domains' rows=5 cols=40>";
echo_file ("/etc/dansguardian/lists/blacklists/ossi/domains");
echo "</textarea></td>";
echo "<td colspan=5 align=center>";
echo "<H3>$l_forbidden_url</H3>$l_forbidden_url_explain<BR>";
echo "<textarea name='OSSI_bl_urls' rows=3 cols=40>";
echo_file ($dir_dg."blacklists/ossi/urls");
echo "<textarea name='OSSI_bl_urls' rows=5 cols=40>";
echo_file ("/etc/dansguardian/lists/blacklists/ossi/urls");
echo "</textarea></td></tr><tr><td colspan=10>";
echo "<input type='submit' value='$l_record'>";
echo "</form> ($l_wait)";
117,62 → 112,6
</td></tr>
</TABLE>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th><?php echo $l_wl; ?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</table>
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
<tr><td valign="middle" align="left" colspan=10>
<FORM action='bl_filter.php' method=POST>
<input type='hidden' name='choix' value='MAJ_cat_wl'>
<?php
echo "<center>$l_wl_categories</center></td></tr>";
//on lit et on interprete le fichier de catégories
$cols=1;
if (file_exists($wl_categories))
{
$pointeur=fopen($wl_categories,"r");
while (!feof ($pointeur))
{
$ligne=fgets($pointeur, 4096);
if ($ligne)
{
if ($cols == 1) { echo "<tr>";}
$categorie=trim(basename($ligne));
echo "<td><a href='bl_categories_help.php?cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=150,toolbar=no,scrollbars=no,resizable=yes') title='categories help page'>$categorie</a><br>";
echo "<input type='checkbox' name='chk-$categorie'";
// si la ligne est commentée -> categorie non selectionnée
if (preg_match('/^#/',$ligne, $r)) { echo ">";}
else { echo "checked>"; }
echo "</td>";
$cols++;
if ($cols > 10) {
echo "</tr>";
$cols=1; }
}
}
fclose($pointeur);
}
else {
echo "$l_error_open_file $wl_categories";
}
echo "<tr><td valign='middle' align='left' colspan=10>";
echo "<center><b>$l_add_to_wl</b></center></td></tr>";
echo "<tr><td colspan=5 align=center>";
echo "<H3>$l_allowed_dns</H3>$l_forbidden_dns_explain<BR>";
echo "<textarea name='OSSI_wl_domains' rows=3 cols=40>";
echo_file ($dir_dg."blacklists/ossi/domains_wl");
echo "</textarea></td>";
echo "<td colspan=5 align=center>";
echo "<H3>$l_allowed_url</H3>$l_forbidden_url_explain<BR>";
echo "<textarea name='OSSI_wl_urls' rows=3 cols=40>";
echo_file ($dir_dg."blacklists/ossi/urls_wl");
echo "</textarea></td></tr><tr><td colspan=10>";
echo "<input type='submit' value='$l_record'>";
echo "</form> ($l_wait)";
?>
</td></tr>
</TABLE>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th><?php echo $l_specific_filtering; ?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</table>
/web/acc/admin/wl_filter.php
0,0 → 1,186
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><!-- written by Rexy -->
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>ALCASAR DNS filtering</TITLE>
<link rel="stylesheet" href="/css/style.css" type="text/css">
</HEAD>
<body>
<?
function form_filter ($form_content)
{
// réencodage iso + format unix + rc fin de ligne (ouf...)
$list = str_replace("\r\n", "\n", utf8_decode($form_content));
if (strlen($list) != 0){
if ($list[strlen($list)-1] != "\n") { $list[strlen($list)]="\n";} ;} ;
return $list;
}
# Choice of language
$Language = 'en';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'fr'){
$l_error_open_file="Erreur d'ouverture du fichier";
$l_main_wl="Liste blanche";
$l_bl_version="Version actuelle :";
$l_wl_categories="Choix des catégories à autoriser";
$l_forbidden_dns="Noms de domaine filtrés";
$l_forbidden_dns_explain="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
$l_one_dns="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
$l_add_to_bl="Noms de domaine ou URLs ajoutés à la liste noire";
$l_forbidden_url="URL filtrés";
$l_forbidden_url_explain="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)";
$l_record="Enregistrer les modifications";
$l_wait="Une fois validées, 30 secondes sont nécessaires pour traiter vos modifications";
}
else {
$l_error_open_file="Error opening the file";
$l_main_wl="Whitelist";
$l_bl_version="Current version : ";
$l_wl_categories="Choice of authorized categories";
$l_forbidden_dns="Filtered domain names";
$l_forbidden_dns_explain="Enter one domain name per row (exemple : .domain.org)";
$l_one_dns="Enter one domain name per row (example : .domain.org)";
$l_add_to_bl="Domain names or URLs to add to blacklist";
$l_forbidden_url="Filtered URL";
$l_forbidden_url_explain="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
$l_record="Save changes";
$l_wait="Once validated, 30 seconds is necessary to compute your modifications";
}
$wl_categories="/usr/local/etc/alcasar-wl-categories";
$wl_categories_enabled="/usr/local/etc/alcasar-wl-categories-enabled";
$dir_blacklist="/etc/dansguardian/lists/blacklist/";
$conf_file="/usr/local/etc/alcasar.conf";
$urlregex_file="/etc/dansguardian/lists/urlregexplist";
$bannedsite_file="/etc/dansguardian/lists/bannedsitelist";
$dir_tmp="/tmp/blacklists";
# default values
if (is_file ($conf_file))
{
$tab=file($conf_file);
if ($tab)
{
foreach ($tab as $line)
{
$field=explode("=", $line);
if ($field[0] == "DNS_FILTERING") {$DNS_FILTERING=trim($field[1]);}
}
}
}
else { echo "$l_error_open_file $conf_file";}
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; }
switch ($choix)
{
case 'MAJ_cat' :
$tab=file($wl_categories_enabled);
if ($tab)
{
$pointeur=fopen($wl_categories_enabled, "w+");
foreach ($_POST as $key => $value)
{
if (strstr($key,'chk-'))
{
$line=str_replace('chk-','',$key)."\n";
fwrite($pointeur,$line);
}
}
fclose($pointeur);
}
else {echo "$l_error_open_file $wl_categories_enabled";}
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/domains","w+");
fputs($fichier, form_filter($_POST['OSSI_bl_domains']));
fclose($fichier);
unset($_POST['OSSI_bl_domains']);
$fichier=fopen("/etc/dansguardian/lists/exceptionsitelist","w+");
fputs($fichier, form_filter($_POST['OSSI_wl_domains']));
fclose($fichier);
unset($_POST['OSSI_wl_domains']);
$fichier=fopen("/etc/dansguardian/lists/blacklists/ossi/urls","w+");
fputs($fichier, form_filter($_POST['OSSI_bl_urls']));
fclose($fichier);
unset($_POST['OSSI_bl_urls']);
$fichier=fopen("/etc/dansguardian/lists/exceptionurllist","w+");
fputs($fichier, form_filter($_POST['OSSI_wl_urls']));
fclose($fichier);
unset($_POST['OSSI_wl_urls']);
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
break;
}
 
function echo_file ($filename)
{
if (file_exists($filename))
{
if (filesize($filename) != 0)
{
$pointeur=fopen($filename,"r");
$tampon = fread($pointeur, filesize($filename));
fclose($pointeur);
echo $tampon;
}
}
else
{
echo "$l_error_openfile $filename";
}
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th><?php echo $l_main_wl; ?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</table>
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
<tr><td valign="middle" align="left" colspan=10>
<FORM action='dns_filter.php' method=POST>
<input type='hidden' name='choix' value='MAJ_cat'>
<?php
echo "<center>$l_wl_categories</center></td></tr>";
//on lit et on interprete le fichier de catégories
$cols=1;
if (file_exists($wl_categories))
{
$pointeur=fopen($wl_categories,"r");
while (!feof ($pointeur))
{
$ligne=fgets($pointeur, 4096);
if ($ligne)
{
if ($cols == 1) { echo "<tr>";}
$categorie=trim(basename($ligne));
echo "<td><a href='bl_categories_help.php?cat=$categorie' target='cat_help' onclick=window.open('bl_categories_help.php','cat_help','width=600,height=150,toolbar=no,scrollbars=no,resizable=yes') title='categories help page'>$categorie</a><br>";
echo "<input type='checkbox' name='chk-$categorie'";
// si la ligne est commentée -> categorie non selectionnée
if (preg_match('/^#/',$ligne, $r)) { echo ">";}
else { echo "checked>"; }
echo "</td>";
$cols++;
if ($cols > 10) {
echo "</tr>";
$cols=1; }
}
}
fclose($pointeur);
}
else {
echo "$l_error_open_file $wl_categories";
}
echo "<tr><td valign='middle' align='left' colspan=10>";
echo "<center><b>$l_add_to_bl</b></center></td></tr>";
echo "<tr><td colspan=5 align=center>";
echo "<H3>$l_forbidden_dns</H3>$l_forbidden_dns_explain<BR>";
echo "<textarea name='OSSI_bl_domains' rows=5 cols=40>";
echo_file ("/etc/dansguardian/lists/blacklists/ossi/domains");
echo "</textarea></td>";
echo "<td colspan=5 align=center>";
echo "<H3>$l_forbidden_url</H3>$l_forbidden_url_explain<BR>";
echo "<textarea name='OSSI_bl_urls' rows=5 cols=40>";
echo_file ("/etc/dansguardian/lists/blacklists/ossi/urls");
echo "</textarea></td></tr><tr><td colspan=10>";
echo "<input type='submit' value='$l_record'>";
echo "</form> ($l_wait)";
?>
</td></tr>
</TABLE>
</BODY>
</HTML>
/web/acc/admin/services.php
75,12 → 75,12
exec("sudo /sbin/service $service $action",$retval, $retstatus);
if ($service == "sshd"){
if ($action == "start"){
exec("sudo /bin/systemctl enable $service.service");
exec("sudo /sbin/chkconfig --add $service");
file_put_contents(CONF_FILE, str_replace('SSH=off', 'SSH=on', file_get_contents(CONF_FILE)));
exec ("sudo /usr/local/bin/alcasar-iptables.sh");
}
if ($action == "stop"){
exec("sudo /bin/systemctl disable $service.service");
exec("sudo /sbin/chkconfig --del $service");
file_put_contents(CONF_FILE, str_replace('SSH=on', 'SSH=off', file_get_contents(CONF_FILE)));
exec ("sudo /usr/local/bin/alcasar-iptables.sh");
}
/web/acc/menu.php
25,7 → 25,8
$l_statistics = "STATISTIQUES";
$l_backup = "SAUVEGARDES";
$l_activity = "Activité";
$l_blacklist = "Noms de domaine";
$l_blacklist = "Liste noire";
$l_whitelist = "Liste blanche";
$l_ldap = "Ldap/A.D.";
$l_access_nb = "Accès au centre";
$l_create_user = "Créer un usager";
51,7 → 52,8
$l_statistics = "STATISTICS";
$l_backup = "BACKUPS";
$l_activity = "Activity";
$l_blacklist = "Domain names";
$l_blacklist = "Blacklist";
$l_whitelist = "Whitelist";
$l_ldap = "Ldap/A.D.";
$l_access_nb = "Access to center";
$l_create_voucher = "Create a quick ticket";
/web/acc/filtering.php
1,10 → 1,12
<?
$select[0]="$l_blacklist";
$select[1]=$l_network;
$select[2]="Exceptions";
$select[1]="$l_whitelist";
$select[2]=$l_network;
$select[3]="Exceptions";
$fich[0]="admin/bl_filter.php";
$fich[1]="admin/net_filter.php";
$fich[2]="admin/filter_exceptions.php";
$fich[1]="admin/wl_filter.php";
$fich[2]="admin/net_filter.php";
$fich[3]="admin/filter_exceptions.php";
$j=0;
$nb=count($select);
while ($j != $nb)