Line 13... |
Line 13... |
13 |
$list = str_replace("\r\n", "\n", utf8_decode($form_content));
|
13 |
$list = str_replace("\r\n", "\n", utf8_decode($form_content));
|
14 |
if (strlen($list) != 0){
|
14 |
if (strlen($list) != 0){
|
15 |
if ($list[strlen($list)-1] != "\n") { $list[strlen($list)]="\n";} ;} ;
|
15 |
if ($list[strlen($list)-1] != "\n") { $list[strlen($list)]="\n";} ;} ;
|
16 |
return $list;
|
16 |
return $list;
|
17 |
}
|
17 |
}
|
- |
|
18 |
function form_filter_ip ($form_content)
|
- |
|
19 |
{
|
- |
|
20 |
$list = form_filter($form_content);
|
- |
|
21 |
$list = preg_replace("/(.*)\n/", "add blacklist_ip_blocked $1\n", $list);
|
- |
|
22 |
return $list;
|
- |
|
23 |
}
|
18 |
# Choice of language
|
24 |
# Choice of language
|
19 |
$Language = 'en';
|
25 |
$Language = 'en';
|
20 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
26 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
21 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
27 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
22 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
28 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
Line 40... |
Line 46... |
40 |
$l_specific_filtering="Filtrage special";
|
46 |
$l_specific_filtering="Filtrage special";
|
41 |
$l_forbidden_dns="Noms de domaine filtrés";
|
47 |
$l_forbidden_dns="Noms de domaine filtrés";
|
42 |
$l_forbidden_dns_explain="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
|
48 |
$l_forbidden_dns_explain="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
|
43 |
$l_allowed_dns="Noms de domaine autorisés";
|
49 |
$l_allowed_dns="Noms de domaine autorisés";
|
44 |
$l_one_dns="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
|
50 |
$l_one_dns="Entrez un nom de domaine par ligne (exemple : .domaine.org)";
|
45 |
$l_maj_rehabilitated="Noms de domaine ou URLs réhabilités";
|
51 |
$l_maj_rehabilitated="Noms de domaine ou IP réhabilités";
|
46 |
$l_rehabilitated_dns="Noms de domaine réhabilités";
|
52 |
$l_rehabilitated_dns="Noms de domaine réhabilités";
|
47 |
$l_rehabilitated_dns_explain="Entrez ici des noms de domaine bloqués par la liste noire <BR> que vous souhaitez réhabiliter.";
|
53 |
$l_rehabilitated_dns_explain="Entrez ici des noms de domaine bloqués par la liste noire <BR> que vous souhaitez réhabiliter.";
|
48 |
$l_add_to_bl="Noms de domaine ou URLs ajoutés à la liste noire";
|
54 |
$l_add_to_bl="Noms de domaine ou IP ajoutés à la liste noire";
|
49 |
$l_add_to_wl="Noms de domaine ou URLs ajoutés à la liste blanche";
|
55 |
$l_add_to_wl="Noms de domaine ou IP ajoutés à la liste blanche";
|
50 |
$l_forbidden_url="URL filtrés";
|
56 |
$l_forbidden_ip="IP filtrés";
|
51 |
$l_forbidden_url_explain="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)";
|
57 |
$l_forbidden_ip_explain="Entrez une IP par ligne (exemple : 123.123.123.123)<br/>ou une ADRESSE RESEAU (exemple : 123.123.0.0/16)";
|
52 |
$l_allowed_url="URL authorisés";
|
58 |
$l_allowed_ip="IP authorisées";
|
53 |
$l_rehabilitated_url="URL réhabilités";
|
59 |
$l_rehabilitated_ip="IP réhabilitées";
|
54 |
$l_rehabilitated_url_explain="Entrez ici des URL bloquées par la liste noire <BR> que vous souhaitez réhabiliter.";
|
60 |
$l_rehabilitated_ip_explain="Entrez ici des IP bloquées par la liste noire <BR> que vous souhaitez réhabiliter.";
|
55 |
$l_one_url="Entrez une URL par ligne (exemple : www.domaine.org/perso/index.htm)";
|
61 |
$l_one_ip="Entrez une IP par ligne (exemple : 123.123.123.123)";
|
56 |
$l_record="Enregistrer les modifications";
|
62 |
$l_record="Enregistrer les modifications";
|
57 |
$l_wait="Une fois validées, 30 secondes sont nécessaires pour traiter vos modifications";
|
63 |
$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications";
|
58 |
$l_ip_filtering="Filtrer les URLs contenant une adresse IP au lieu d'un nom de domaine (ex: http://25.56.58.59/index.htm)";
|
64 |
$l_ip_filtering="Filtrer les URLs contenant une adresse IP au lieu d'un nom de domaine (ex: http://25.56.58.59/index.htm)";
|
59 |
$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche : google, yahoo, bing, metacrawler et Youtube.";
|
65 |
$l_safe_searching="Activer le contrôle scolaire/parental des moteurs de recherche : google, yahoo, bing, metacrawler et Youtube.";
|
60 |
$l_safe_youtube="Pour Youtube, entrez votre identifiant ici : ";
|
66 |
$l_safe_youtube="Pour Youtube, entrez votre identifiant ici : ";
|
61 |
$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>)";
|
67 |
$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>)";
|
62 |
$l_error_open_file="Erreur d'ouverture du fichier";
|
68 |
$l_error_open_file="Erreur d'ouverture du fichier";
|
- |
|
69 |
$l_ip_file_title="Fichier d'IP";
|
- |
|
70 |
$l_file_list="Liste des fichiers IP";
|
- |
|
71 |
$l_add_ip_file="Ajouter un fichier d'IP (une IP par ligne)";
|
- |
|
72 |
$l_file_name="Nom du fichier";
|
- |
|
73 |
$l_file_remove="Supprimer";
|
- |
|
74 |
$l_error_upload="Erreur d'envoi du fichier d'ip";
|
- |
|
75 |
$l_remove="Supprimer";
|
- |
|
76 |
$l_submit="Envoyer";
|
- |
|
77 |
$l_nb_ip="Nombre d'IP";
|
63 |
}
|
78 |
}
|
64 |
else {
|
79 |
else {
|
65 |
$l_title1="Domain names and URL filtering";
|
80 |
$l_title1="Domain names and URL filtering";
|
66 |
$l_dnsfilter_on="Actually, the Domain name and URL filter is on";
|
81 |
$l_dnsfilter_on="Actually, the Domain name and URL filter is on";
|
67 |
$l_dnsfilter_off="Actually, the Domain name and URL filter is off";
|
82 |
$l_dnsfilter_off="Actually, the Domain name and URL filter is off";
|
Line 81... |
Line 96... |
81 |
$l_specific_filtering="Specific filtering";
|
96 |
$l_specific_filtering="Specific filtering";
|
82 |
$l_forbidden_dns="Filtered domain names";
|
97 |
$l_forbidden_dns="Filtered domain names";
|
83 |
$l_forbidden_dns_explain="Enter one domain name per row (exemple : .domain.org)";
|
98 |
$l_forbidden_dns_explain="Enter one domain name per row (exemple : .domain.org)";
|
84 |
$l_allowed_dns="Allowed domain names";
|
99 |
$l_allowed_dns="Allowed domain names";
|
85 |
$l_one_dns="Enter one domain name per row (example : .domain.org)";
|
100 |
$l_one_dns="Enter one domain name per row (example : .domain.org)";
|
86 |
$l_maj_rehabilitated="Domain names or URLs rehabilitated";
|
101 |
$l_maj_rehabilitated="Domain names or IP rehabilitated";
|
87 |
$l_rehabilitated_dns="Rehabilitated domain names";
|
102 |
$l_rehabilitated_dns="Rehabilitated domain names";
|
88 |
$l_rehabilitated_dns_explain="Enter here domain names that are blocked by the blacklist <BR> and you want to rehabilitate.";
|
103 |
$l_rehabilitated_dns_explain="Enter here domain names that are blocked by the blacklist <BR> and you want to rehabilitate.";
|
89 |
$l_add_to_bl="Domain names or URLs to add to blacklist";
|
104 |
$l_add_to_bl="Domain names or IP to add to blacklist";
|
90 |
$l_add_to_wl="Domain names or URLs to add to whitelist";
|
105 |
$l_add_to_wl="Domain names or IP to add to whitelist";
|
91 |
$l_forbidden_url="Filtered URL";
|
106 |
$l_forbidden_ip="Filtered IP";
|
92 |
$l_forbidden_url_explain="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
|
107 |
$l_forbidden_ip_explain="Enter one IP per row (example : 123.123.123.123)<br/>or a NETWORK ADDRESS (example : 123.123.0.0/16)";
|
93 |
$l_allowed_url="Allowed URL";
|
108 |
$l_allowed_ip="Allowed IP";
|
94 |
$l_rehabilitated_url="Rehabilitated URL";
|
109 |
$l_rehabilitated_ip="Rehabilitated IP";
|
95 |
$l_rehabilitated_url_explain="Enter here URL that are blocked by the blacklist <BR> and you want to rehabilitate.";
|
110 |
$l_rehabilitated_ip_explain="Enter here IP that are blocked by the blacklist <BR> and you want to rehabilitate.";
|
96 |
$l_one_url="Enter one URL per row (example : www.domaine.org/perso/index.htm)";
|
111 |
$l_one_ip="Enter one IP per row (example : 123.123.123.123)";
|
97 |
$l_record="Save changes";
|
112 |
$l_record="Save changes";
|
98 |
$l_wait="Once validated, 30 seconds is necessary to compute your modifications";
|
113 |
$l_wait="Once validated, 10 seconds is necessary to compute your modifications";
|
99 |
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
|
114 |
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)";
|
100 |
$l_safe_searching="Enabling school/parental control for the search engines google, yahoo, bing, metacrawler and Youtube.";
|
115 |
$l_safe_searching="Enabling school/parental control for the search engines google, yahoo, bing, metacrawler and Youtube.";
|
101 |
$l_safe_youtube="For Youtube, enter your ID here : ";
|
116 |
$l_safe_youtube="For Youtube, enter your ID here : ";
|
102 |
$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>)";
|
117 |
$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>)";
|
103 |
$l_error_open_file="Error opening file";
|
118 |
$l_error_open_file="Error opening file";
|
- |
|
119 |
$l_ip_file_title="IP files";
|
- |
|
120 |
$l_file_list="IP files list";
|
- |
|
121 |
$l_add_ip_file="Add a file of IP (one IP per line)";
|
- |
|
122 |
$l_file_name="Filename";
|
- |
|
123 |
$l_file_remove="Remove";
|
- |
|
124 |
$l_error_upload="Error during the upload process";
|
- |
|
125 |
$l_remove="Delete";
|
- |
|
126 |
$l_submit="Submit";
|
- |
|
127 |
$l_nb_ip="Number of IP";
|
104 |
}
|
128 |
}
|
105 |
$dir_etc="/usr/local/etc/";
|
129 |
$dir_etc="/usr/local/etc/";
|
106 |
$dir_dg="/etc/dansguardian/lists/";
|
130 |
$dir_dg="/etc/dansguardian/lists/";
|
- |
|
131 |
$dir_bl_ip="/usr/local/share/iptables-bl/";
|
107 |
$bl_categories=$dir_etc."alcasar-bl-categories";
|
132 |
$bl_categories=$dir_etc."alcasar-bl-categories";
|
108 |
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
|
133 |
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled";
|
109 |
$wl_categories=$dir_etc."alcasar-wl-categories";
|
134 |
$wl_categories=$dir_etc."alcasar-wl-categories";
|
110 |
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
|
135 |
$wl_categories_enabled=$dir_etc."alcasar-wl-categories-enabled";
|
111 |
$conf_file=$dir_etc."alcasar.conf";
|
136 |
$conf_file=$dir_etc."alcasar.conf";
|
112 |
$dir_blacklist=$dir_dg."blacklist/";
|
137 |
$dir_blacklist=$dir_dg."blacklist/";
|
113 |
$urlregex_file=$dir_dg."urlregexplist";
|
138 |
$urlregex_file=$dir_dg."urlregexplist";
|
114 |
$bannedsite_file=$dir_dg."bannedsitelist";
|
139 |
$bannedsite_file=$dir_dg."bannedsitelist";
|
115 |
$dir_tmp="/tmp/blacklists";
|
140 |
$dir_tmp="/tmp/blacklists";
|
- |
|
141 |
$upload_dir = "/usr/local/share/iptables-bl-enabled/";
|
116 |
# default values
|
142 |
# default values
|
117 |
if (is_file ($conf_file))
|
143 |
if (is_file ($conf_file))
|
118 |
{
|
144 |
{
|
119 |
$tab=file($conf_file);
|
145 |
$tab=file($conf_file);
|
120 |
if ($tab)
|
146 |
if ($tab)
|
Line 159... |
Line 185... |
159 |
if (strstr($key,'chk-'))
|
185 |
if (strstr($key,'chk-'))
|
160 |
{
|
186 |
{
|
161 |
$line=str_replace('chk-','',$key)."\n";
|
187 |
$line=str_replace('chk-','',$key)."\n";
|
162 |
fwrite($pointeur,$line);
|
188 |
fwrite($pointeur,$line);
|
163 |
}
|
189 |
}
|
164 |
echo "$key<br/>";
|
- |
|
165 |
}
|
190 |
}
|
166 |
fclose($pointeur);
|
191 |
fclose($pointeur);
|
167 |
}
|
192 |
}
|
168 |
else {echo "$l_error_open_file $bl_categories_enabled";}
|
193 |
else {echo "$l_error_open_file $bl_categories_enabled";}
|
169 |
$fichier=fopen($dir_dg."blacklists/ossi/domains","w+");
|
194 |
$fichier=fopen($dir_dg."blacklists/ossi/domains","w+");
|
Line 172... |
Line 197... |
172 |
unset($_POST['OSSI_bl_domains']);
|
197 |
unset($_POST['OSSI_bl_domains']);
|
173 |
$fichier=fopen($dir_dg."exceptionsitelist","w+");
|
198 |
$fichier=fopen($dir_dg."exceptionsitelist","w+");
|
174 |
fputs($fichier, form_filter($_POST['BL_rehabilited_domains']));
|
199 |
fputs($fichier, form_filter($_POST['BL_rehabilited_domains']));
|
175 |
fclose($fichier);
|
200 |
fclose($fichier);
|
176 |
unset($_POST['BL_rehabilited_domains']);
|
201 |
unset($_POST['BL_rehabilited_domains']);
|
177 |
$fichier=fopen($dir_dg."blacklists/ossi/urls","w+");
|
202 |
$fichier=fopen($dir_bl_ip."ossi","w+");
|
178 |
fputs($fichier, form_filter($_POST['OSSI_bl_urls']));
|
203 |
fputs($fichier, form_filter_ip($_POST['OSSI_bl_ip']));
|
179 |
fclose($fichier);
|
204 |
fclose($fichier);
|
180 |
unset($_POST['OSSI_bl_urls']);
|
205 |
unset($_POST['OSSI_bl_ip']);
|
181 |
$fichier=fopen($dir_dg."exceptionurllist","w+");
|
206 |
$fichier=fopen($dir_dg."exceptioniplist","w+");
|
182 |
fputs($fichier, form_filter($_POST['BL_rehabilited_urls']));
|
207 |
fputs($fichier, form_filter($_POST['BL_rehabilited_ip']));
|
183 |
fclose($fichier);
|
208 |
fclose($fichier);
|
184 |
unset($_POST['BL_rehabilited_urls']);
|
209 |
unset($_POST['BL_rehabilited_ip']);
|
185 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
|
210 |
exec ("sudo /usr/local/sbin/alcasar-bl.sh --reload");
|
186 |
break;
|
211 |
break;
|
187 |
case 'MAJ_cat_wl' :
|
212 |
case 'MAJ_cat_wl' :
|
188 |
$tab=file($wl_categories_enabled);
|
213 |
$tab=file($wl_categories_enabled);
|
189 |
if ($tab)
|
214 |
if ($tab)
|
Line 221... |
Line 246... |
221 |
else {$New_ID=$_POST['Youtube_ID'];}
|
246 |
else {$New_ID=$_POST['Youtube_ID'];}
|
222 |
file_put_contents($conf_file, str_replace("YOUTUBE_ID=$YOUTUBE_ID", "YOUTUBE_ID=$New_ID", file_get_contents($conf_file)));
|
247 |
file_put_contents($conf_file, str_replace("YOUTUBE_ID=$YOUTUBE_ID", "YOUTUBE_ID=$New_ID", file_get_contents($conf_file)));
|
223 |
$YOUTUBE_ID=$New_ID;
|
248 |
$YOUTUBE_ID=$New_ID;
|
224 |
exec ("sudo /usr/local/sbin/alcasar-url_filter.sh $safesearch $pureip");
|
249 |
exec ("sudo /usr/local/sbin/alcasar-url_filter.sh $safesearch $pureip");
|
225 |
break;
|
250 |
break;
|
- |
|
251 |
case 'MAJ_ip_file_delete' :
|
- |
|
252 |
foreach($_POST as $fichier => $value)
|
- |
|
253 |
{
|
- |
|
254 |
if($fichier != "choix")
|
- |
|
255 |
{
|
- |
|
256 |
exec("rm -rf $upload_dir$fichier");
|
- |
|
257 |
}
|
- |
|
258 |
}
|
- |
|
259 |
exec ("sudo /usr/local/bin/alcasar-iptables.sh");
|
- |
|
260 |
break;
|
- |
|
261 |
case 'MAJ_ip_file_upload' :
|
- |
|
262 |
$nom = basename($_FILES['fichier_ip']['name']);
|
- |
|
263 |
# Si un fichier a été choisi
|
- |
|
264 |
if(!empty($nom))
|
- |
|
265 |
{
|
- |
|
266 |
# On l'upload
|
- |
|
267 |
if(move_uploaded_file($_FILES['fichier_ip']['tmp_name'], $upload_dir."ossi-".$nom))
|
- |
|
268 |
{
|
- |
|
269 |
exec("sed -i \"s/^/add blacklist_ip_blocked /g\" $upload_dir\ossi-$nom"); # On crée la sauvegarde du set
|
- |
|
270 |
}
|
- |
|
271 |
else
|
- |
|
272 |
{
|
- |
|
273 |
echo $l_error_upload;
|
- |
|
274 |
}
|
- |
|
275 |
}
|
- |
|
276 |
exec ("sudo /usr/local/bin/alcasar-iptables.sh");
|
- |
|
277 |
break;
|
226 |
}
|
278 |
}
|
227 |
?>
|
279 |
?>
|
228 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
|
280 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=0>
|
229 |
<tr><th><?php echo "$l_title1"; ?></th></tr>
|
281 |
<tr><th><?php echo "$l_title1"; ?></th></tr>
|
230 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
|
282 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width=1 height=2></td></tr>
|