1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
5 File : $Source: /cvsroot/ijbswa/current/doc/webserver/actions/step3.php,v $
7 Purpose : Submit form for actions file feedback (step 1)
9 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
11 $Id: step3.php,v 1.12 2002/04/06 18:57:38 swa Exp $
14 Revision 1.12 2002/04/06 18:57:38 swa
15 first version of the script that writes the
16 logfile with all submissions and additionally
17 submits the entries to our tracker.
19 Revision 1.11 2002/04/06 15:54:08 swa
20 prework: list of what needs to
21 be submitted to the tracker.
23 Revision 1.10 2002/04/06 15:19:35 oes
24 Clean-up, smarter handling of unreachable URLs
26 Revision 1.9 2002/04/06 11:34:44 oes
29 Revision 1.8 2002/04/04 19:48:11 oes
30 Reactivating the scripts ,-)
32 Revision 1.7 2002/04/04 10:29:58 oes
33 Keeping feedback confidential
35 Revision 1.6 2002/04/03 19:36:04 swa
38 Revision 1.5 2002/04/02 07:22:43 oes
41 Revision 1.4 2002/04/01 19:13:47 oes
42 Extended, fixed bugs, beefed up design, made IE-safe
44 Revision 1.3 2002/03/30 20:44:46 swa
45 have consistent look and feel. part 2.
48 Revision 1.2 2002/03/30 19:49:34 swa
49 have consistent look and feel
51 Revision 1.1 2002/03/30 03:20:30 oes
52 Added Feedback mechanism for actions file
55 Copyright (C) 2002 the SourceForge Privoxy team.
56 http://www.privoxy.org/
58 Written by Andreas Oesterhelt
60 This program is free software; you can redistribute it
61 and/or modify it under the terms of the GNU General
62 Public License as published by the Free Software
63 Foundation; either version 2 of the License, or (at
64 your option) any later version.
66 This program is distributed in the hope that it will
67 be useful, but WITHOUT ANY WARRANTY; without even the
68 implied warranty of MERCHANTABILITY or FITNESS FOR A
69 PARTICULAR PURPOSE. See the GNU General Public
70 License for more details.
72 The GNU General Public License should be included with
73 this file. If not, you can view it at
74 http://www.gnu.org/copyleft/gpl.html
75 or write to the Free Software Foundation, Inc., 59
76 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
81 <meta http-equiv="Content-Style-Type" content="text/css">
82 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
83 <link rel="stylesheet" type="text/css" href="../p_feedback.css">
91 $logfile = "results/actions-feedback.txt";
98 //error_reporting(E_ALL);
99 error_reporting(E_NONE);
102 * Function: error_abort
103 * Purpose: Return an error page with $title and $message
105 function error_abort($title, $message)
107 if ($title == "invalid") /* shortcut */
109 $title = "Invalid Feedback Submission";
112 echo (" <title>Privoxy: $title</title>
115 <div class=\"title\">
117 <a href=\"http://www.privoxy.org/\">Privoxy</a>: $title
121 <div class=\"errorbox\">
125 <p>Valid <a href=\"http://validator.w3.org/\">HTML 4.01 Transitional</a></p>
133 * Cannot start with step 3:
135 if (!isset($referrer_url))
137 error_abort("invalid", "When submitting your feedback please start with <a href=\"index.php\">step 1</a>.");
142 * Cannot work on unknown problem:
144 if (!isset($problem))
146 error_abort("invalid", "You need to select the nature of the problem in <a href=\"index.php\">step 1</a>.");
151 * Don't accept unconfirmed URLs
153 if (!isset($url_confirmed))
155 error_abort("invalid", "When submitting URLs that this script can't retrieve, you need to check \"Yes, I'm sure\"
156 <a href=\"javascript:history.back();\">step 2</a>.");
161 * Handle optional text fields:
163 if (!isset($name) || ($name == ""))
170 * Open the logfile or fail:
172 $fp = fopen($logfile, "a");
176 echo (" <title>Internal Script Error</title>
179 <div class=\"title\">
180 <h1><a href=\"http://www.privoxy.org/\">Privoxy</a>: Internal Script Error</h1>
183 <div class=\"errorbox\">
185 This script was unable to open its logfile.
188 Please <a href=\"mailto:info@privoxy.org?SUBJECT=Feedback-Script-Broken\">mail its owner</a>!
199 * Write Head (type, severity, user, client-ip)
202 fwrite($fp, "\n#FEEDBACK TYPE $problem SEVERITY $severity FROM $name ON $REMOTE_ADDR VERIFIED $url_confirmed TIME " . date("r") ."\n");
205 $lines = explode("\n", $remarks);
206 foreach ($lines as $line)
208 fwrite($fp, "#REMARKS: $line\n");
214 * Depending on the type of problem reported,
215 * we need to write additional data:
220 * Banner not blocked:
223 fwrite($fp, "#BLOCK-REFERRER: $referrer_url\n");
224 if (isset($num_images))
226 for($i=0; $i < $num_images; $i++)
228 if (isset($block_image[$i]))
230 fwrite($fp, "#BLOCK-URL: $image_url[$i]\n");
231 $trackertext .= "Block image: $image_url[$i]\n";
235 if (isset($manual_image_url) && ($manual_image_url != ""))
237 fwrite($fp, "#BLOCK-URL: $manual_image_url\n");
238 $trackertext .= "Block image: $manual_image_url\n";
243 * Innocent image blocked:
246 fwrite($fp, "#UNBLOCK-REFERRER: $referrer_url\n");
247 if (isset($image_url) && ($image_url != ""))
249 fwrite($fp, "#UNBLOCK-URL: $image_url\n");
250 $trackertext .= "Unblock image: $image_url\n";
255 * All other problems:
258 fwrite($fp, "#PROBLEM-URL: $referrer_url\n");
265 * Notify our SF tracker that new data is waiting to be
270 case "P1": $category_id="412811"; $summary = "Ad not blocked "; break;
271 case "P2": $category_id="412810"; $summary = "Image blocked ";break;
272 case "P3": $category_id="412812"; $summary = "Page plocked ";break;
273 case "P4": $category_id="412813"; $summary = "Popups blocked ";break;
274 case "P5": $category_id="412814"; $summary = "Other problem ";break;
275 default: $category_id="412814"; $summary = "IMPOSSIBLE ";break;
278 $summary .= date("U"); /* Must be unique */
279 $priority = 3 * $severity;
281 $details = urlencode("On " . date("r") . " new data was received from $name:\n"
282 ."URL: $referrer_url\n$trackertext\nRemarks:\n\n$remarks");
284 $postfields = ( "group_id=11118&atid=460288&func=postadd&category_id=$category_id&artifact_group_id=195890" .
285 "&priority=$priority&summary=$summary&details=$details" );
287 $ch = curl_init ("http://sourceforge.net/tracker/index.php");
288 curl_setopt($ch, CURLOPT_HEADER, 0);
289 curl_setopt($ch, CURLOPT_FAILONERROR, 1);
290 curl_setopt($ch, CURLOPT_TIMEOUT, 20);
291 curl_setopt($ch, CURLOPT_POST, 1);
292 curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
302 <title>Privoxy Action List Feedback - Result</title>
308 <a href="http://www.privoxy.org" target="_blank">Privoxy</a> Action List Feedback - Result
314 <b>Thank you very much for taking the time to submit your feedback!</b>
318 It will be reviewed by the developers and used to improve the
319 distribution actions file.
323 <input type="submit" value="Close this window" onclick="window.close();">
328 <p>Valid <a href="http://validator.w3.org/">HTML 4.01 Transitional</a></p>