/usr/share/sarg/sarg-php/sarg-squidguard-block.php is in sarg 2.3.6-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | <?php
/*
* AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com
* 1998, 2006
* SARG Squid Analysis Report Generator http://sarg-squid.org
*
* SARG donations:
* please look at http://sarg.sourceforge.net/donations.php
* ---------------------------------------------------------------------
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
*/
// Change to squidGuard and sarg config file paths
$SargConf = "/etc/squid/sarg.conf";
$squidGuardConf = "/etc/squid/squidGuard.conf";
global $SargConf;
global $dbhome;
global $language;
include_once("language.php");
include_once("style.php");
$url = $_GET['url'];
function parse_config($line,$clave) {
if (preg_match("/dbhome/i", $line)) {
global $dbhome;
$l = explode(' ', $line);
list(, $dbhome) = $l;
$dbhome=preg_replace('/\s+/','',$dbhome);
}
}
echo "<center>\n";
echo "<table>\n";
echo "<tr><td class=\"title\">";
print(gettext ("Sarg-SquidGuard - URL Blocking"));
echo "</td></tr>\n";
echo "<tr><td class=\"header2\">";
print(gettext ("Choose the rule set where"));
echo "<a href=\"http://$url\"> $url</a> ";
print(gettext ("will by added"));
echo "</td></tr>\n";
echo "</table>\n";
echo "<table>\n";
$lines=file($squidGuardConf);
array_walk($lines,'parse_config');
if (is_dir($dbhome)) {
if ($ha1 = opendir($dbhome)) {
while (false !== ($file = readdir($ha1))) {
if ($file == '.' || $file == '..') continue;
echo "<tr><td class=\"header\">$file</td></tr>\n";
$dir2 = $dbhome.'/'.$file;
if (is_dir($dir2)) {
if ($ha2 = opendir($dir2)) {
while (false !== ($file2 = readdir($ha2))) {
if ($file2 == '.' || $file2 == '..') continue;
echo "<tr><td class=\"data2\"><a href=\"sarg-squidguard-block2.php?file=$dir2/$file2&url=$url&lang=$language\">$file2</a></td></tr>\n";
}
}
closedir($ha2);
}
}
closedir($ha1);
}
}
echo "</table>\n";
echo "</html>\n";
?>
|