",gettext("No file passed as argument"),"

\n"; exit; } $file = $_GET['file']; if (!isset($_GET['url'])) { echo "

",gettext("No url passed as argument"),"

\n"; exit; } $url = $_GET['url']; if (!check_url($url)) { echo "

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

\n"; exit; } $url = $url."\n"; putenv("LANG=$language"); if (!setlocale(LC_ALL, $language)) { echo "

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

\n"; exit; } $domain = 'messages'; bindtextdomain($domain, "./locale"); textdomain($domain); function parse_config($line,$clave) { if (preg_match("/dbhome/i", $line)) { global $dbhome; $l = explode(' ', $line); list(, $dbhome) = $l; $dbhome=preg_replace('/\s+/','',$dbhome); } } global $dbhome; $lines=file($squidGuardConf); array_walk($lines,'parse_config'); $file=$dbhome.'/'.$file; ?> <?php echo gettext("Sarg-SquidGuard - URL Blocking")?> "; printf(gettext("Could not open file: %s"),$file); echo "

\n"; exit; } $written = fwrite($ha, $url); fclose($ha); if ($written != strlen($url)) { echo "

"; echo gettext("Write error"); echo "

\n"; exit; } echo "

",gettext("Done!"),"

\n

"; printf(gettext("Return to Sarg."),"javascript:history.go(-2)"); echo "

\n"; ?>