]> git.ipfire.org Git - thirdparty/sarg.git/blame - sarg-php/sarg-block-it.php
Read compressed useragent logs
[thirdparty/sarg.git] / sarg-php / sarg-block-it.php
CommitLineData
25697a35
GS
1<?php
2
3/*
d6e703cc
FM
4 * AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com
5 * 1998, 2006
25697a35
GS
6 * SARG Squid Analysis Report Generator http://sarg-squid.org
7 *
8 * SARG donations:
9 * please look at http://sarg.sourceforge.net/donations.php
10 * ---------------------------------------------------------------------
11 *
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.
16 *
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.
21 *
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.
25 *
26 */
27
8b764408 28require_once "config.php.inc";
25697a35 29
8b764408
FM
30if (!isset($_GET['url']))
31{
32 echo "<p>",gettext("No URL passed as argument"),"</p>\n";
33 exit;
34}
25697a35
GS
35$url = $_GET['url'];
36$url = $url."\n";
37
8b764408
FM
38$ha = fopen($DefaultSquidBlock, 'a');
39if ($ha == false) {
40 printf(gettext("Could not open file: %s"),$DefaultSquidBlock);
25697a35
GS
41 exit;
42}
43else {
44 $written = fwrite($ha, $url);
45 fclose($ha);
46 if ($written != strlen($url)) {
47 print (gettext ("Write error"));
48 exit;
49 }
50 print (gettext ("Done!"));
51 echo "<br><br>\n";
8b764408 52 printf(gettext("<a href=\"%s\">Return</a> to Sarg."),"javascript:history.go(-1)");
25697a35 53}