]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | ||
3 | /* | |
4 | * AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com | |
5 | * 1998, 2006 | |
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 | ||
28 | require_once "config.php.inc"; | |
29 | ||
30 | if (!isset($_GET['url'])) | |
31 | { | |
32 | echo "<p>",gettext("No URL passed as argument"),"</p>\n"; | |
33 | exit; | |
34 | } | |
35 | $url = $_GET['url']; | |
36 | $url = $url."\n"; | |
37 | ||
38 | $ha = fopen($DefaultSquidBlock, 'a'); | |
39 | if ($ha == false) { | |
40 | printf(gettext("Could not open file: %s"),$DefaultSquidBlock); | |
41 | exit; | |
42 | } | |
43 | else { | |
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"; | |
52 | printf(gettext("<a href=\"%s\">Return</a> to Sarg."),"javascript:history.go(-1)"); | |
53 | } |