]>
git.ipfire.org Git - thirdparty/sarg.git/blob - sarg-php/sarg-squidguard-block.php
c403a0d324a931cb2528f68040929e3d88461bf2
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 // Change to squidGuard and sarg config file paths
29 $SargConf = "/usr/local/sarg/sarg.conf";
30 $squidGuardConf = "/usr/local/squidGuard/squidGuard.conf";
36 include_once("language.php");
37 include_once("style.php");
40 $squidGuard_conf = '/usr/local/squidGuard/squidGuard.conf';
42 function parse_config($line,$clave) {
43 if (preg_match("/dbhome/i", $line)) {
45 $l = explode(' ', $line);
47 $dbhome=preg_replace('/\s+/','',$dbhome);
53 echo "<tr><td class=\"title\">";
54 print(gettext ("Sarg-SquidGuard - URL Blocking"));
56 echo "<tr><td class=\"header2\">";
57 print(gettext ("Choose the rule set where"));
58 echo "<a href=\"http://$url\"> $url</a> ";
59 print(gettext ("will by added"));
64 $lines=file($squidGuardConf);
65 array_walk($lines,'parse_config');
67 if (is_dir($dbhome)) {
68 if ($ha1 = opendir($dbhome)) {
69 while (false !== ($file = readdir($ha1))) {
70 if ($file == '.' ||
$file == '..') continue;
71 echo "<tr><td class=\"header\">$file</td></tr>\n";
72 $dir2 = $dbhome.'/'.$file;
74 if ($ha2 = opendir($dir2)) {
75 while (false !== ($file2 = readdir($ha2))) {
76 if ($file2 == '.' ||
$file2 == '..') continue;
77 echo "<tr><td class=\"data2\"><a href=\"sarg-squidguard-block2.php?file=$dir2/$file2&url=$url&lang=$language\">$file2</a></td></tr>\n";