]>
git.ipfire.org Git - thirdparty/sarg.git/blob - sarg-php/sarg-squidguard-block.php
4 * AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com
6 * SARG Squid Analysis Report Generator http://sarg-squid.org
9 * please look at http://sarg.sourceforge.net/donations.php
10 * ---------------------------------------------------------------------
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
28 require_once "config.php.inc";
33 putenv("LANG=$language");
34 if (!setlocale(LC_ALL
, $language))
37 printf(gettext("Invalid locale: %s"),$language);
42 bindtextdomain($domain, "./locale");
44 include_once("style.php");
46 if (!isset($_GET['url']))
48 echo "<p>",gettext("No URL to block"),"</p>\n";
54 function parse_config($line,$clave) {
55 if (preg_match("/dbhome/i", $line)) {
57 $l = explode(' ', $line);
59 $dbhome=preg_replace('/\s+/','',$dbhome);
65 echo "<tr><td class=\"title\">";
66 print(gettext ("Sarg-SquidGuard - URL Blocking"));
68 echo "<tr><td class=\"header2\">";
69 printf(gettext("Choose the rule set where %s will be added"),"<a href=\"http://$url\">$url</a> ");
74 $lines=file($squidGuardConf);
75 array_walk($lines,'parse_config');
77 if (is_dir($dbhome)) {
78 if ($ha1 = opendir($dbhome)) {
79 while (false !== ($file = readdir($ha1))) {
80 if ($file == '.' ||
$file == '..') continue;
81 echo "<tr><td class=\"header\">$file</td></tr>\n";
82 $dir2 = $dbhome.'/'.$file;
84 if ($ha2 = opendir($dir2)) {
85 while (false !== ($file2 = readdir($ha2))) {
86 if ($file2 == '.' ||
$file2 == '..') continue;
87 echo "<tr><td class=\"data2\"><a href=\"sarg-squidguard-block2.php?file=$dir2/$file2&url=$url&lang=$language\">$file2</a></td></tr>\n";