"; printf(gettext("Invalid locale: %s"),$language); echo "

\n"; exit; } $domain = 'messages'; bindtextdomain($domain, "./locale"); textdomain($domain); include_once("style.php"); if (!isset($_GET['url'])) { echo "

",gettext("No URL to block"),"

\n"; exit; } $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); } } $lines=file($squidGuardConf); array_walk($lines,'parse_config'); ?> <?php echo gettext("Sarg-SquidGuard - URL Blocking")?>
$url")?>
"; printf(gettext("The path %s (which is supposed to be the squidGuard DB home) is not a directory"),$dbhome); echo "

\n"; } else { $ha1 = opendir($dbhome); if ($ha1) { $table=false; while (false !== ($file = readdir($ha1))) { if ($file == '.' || $file == '..') continue; $dir2 = $dbhome.'/'.$file; if (is_dir($dir2)) { if ($ha2 = opendir($dir2)) { $first=true; while (false !== ($file2 = readdir($ha2))) { if ($file2 == '.' || $file2 == '..') continue; if (!$table) { echo "\n"; $table=true; } if ($first) { echo "\n"; $first=false; } echo "\n"; } } closedir($ha2); } } closedir($ha1); if ($table) { echo "
$file
$file2
\n"; } else { echo "

"; printf(gettext("No squidGuard rule found in %s"),$dbhome); echo "

\n"; } } else { echo "

"; printf(gettext("Cannot read squidGuard DB home directory %s"),$dbhome); echo "

\n"; } } ?>