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.16.2.2 2002/08/23 16:46:05 oes Exp $
14 Revision 1.16.2.2 2002/08/23 16:46:05 oes
15 Adapt to master file format
17 Revision 1.16.2.1 2002/08/23 12:25:31 oes
20 Revision 1.16 2002/04/13 14:34:59 oes
21 Include unique ID in tracker and log; Include URL in tracker summary; add more newlines in tracker
23 Revision 1.15 2002/04/09 15:08:10 oes
24 Restoring lost text change
26 Revision 1.14 2002/04/08 17:04:05 oes
27 Adapt to unified stylesheet
29 Revision 1.13 2002/04/07 17:11:40 oes
30 Tracker submit via curl (no need for user to see), fixing problems, removing monster comments
32 Revision 1.12 2002/04/06 18:57:38 swa
33 first version of the script that writes the
34 logfile with all submissions and additionally
35 submits the entries to our tracker.
37 Revision 1.11 2002/04/06 15:54:08 swa
38 prework: list of what needs to
39 be submitted to the tracker.
41 Revision 1.10 2002/04/06 15:19:35 oes
42 Clean-up, smarter handling of unreachable URLs
44 Revision 1.9 2002/04/06 11:34:44 oes
47 Revision 1.8 2002/04/04 19:48:11 oes
48 Reactivating the scripts ,-)
50 Revision 1.7 2002/04/04 10:29:58 oes
51 Keeping feedback confidential
53 Revision 1.6 2002/04/03 19:36:04 swa
56 Revision 1.5 2002/04/02 07:22:43 oes
59 Revision 1.4 2002/04/01 19:13:47 oes
60 Extended, fixed bugs, beefed up design, made IE-safe
62 Revision 1.3 2002/03/30 20:44:46 swa
63 have consistent look and feel. part 2.
66 Revision 1.2 2002/03/30 19:49:34 swa
67 have consistent look and feel
69 Revision 1.1 2002/03/30 03:20:30 oes
70 Added Feedback mechanism for actions file
73 Copyright (C) 2002 the SourceForge Privoxy team.
74 http://www.privoxy.org/
76 Written by Andreas Oesterhelt
78 This program is free software; you can redistribute it
79 and/or modify it under the terms of the GNU General
80 Public License as published by the Free Software
81 Foundation; either version 2 of the License, or (at
82 your option) any later version.
84 This program is distributed in the hope that it will
85 be useful, but WITHOUT ANY WARRANTY; without even the
86 implied warranty of MERCHANTABILITY or FITNESS FOR A
87 PARTICULAR PURPOSE. See the GNU General Public
88 License for more details.
90 The GNU General Public License should be included with
91 this file. If not, you can view it at
92 http://www.gnu.org/copyleft/gpl.html
93 or write to the Free Software Foundation, Inc., 59
94 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
99 <meta http-equiv="Content-Style-Type" content="text/css">
100 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
101 <link rel="stylesheet" type="text/css" href="../privoxy.css">
102 <link rel="stylesheet" type="text/css" href="../p_feedback.css">
109 $logfile = "results/actions-feedback.txt";
116 //error_reporting(E_ALL);
117 error_reporting(E_NONE);
120 * Function: error_abort
121 * Purpose: Return an error page with $title and $message
123 function error_abort($title, $message)
125 if ($title == "invalid") /* shortcut */
127 $title = "Invalid Feedback Submission";
130 echo (" <title>Privoxy: $title</title>
133 <div class=\"title\">
135 <a href=\"http://www.privoxy.org/\">Privoxy</a>: $title
139 <div class=\"warning\">
143 <p>Valid <a href=\"http://validator.w3.org/\">HTML 4.01 Transitional</a></p>
151 * Cannot start with step 3:
153 if (!isset($referrer_url))
155 error_abort("invalid", "When submitting your feedback please start with <a href=\"index.php\">step 1</a>.");
160 * Cannot work on unknown problem:
162 if (!isset($problem))
164 error_abort("invalid", "You need to select the nature of the problem in <a href=\"index.php\">step 1</a>.");
169 * Don't accept unconfirmed URLs
171 if (!isset($url_confirmed))
173 error_abort("invalid", "When submitting URLs that this script can't retrieve, you need to check \"Yes, I'm sure\"
174 <a href=\"javascript:history.back();\">step 2</a>.");
179 * Handle optional text fields:
181 if (!isset($name) || ($name == ""))
189 $item_id = date("U");
193 * Open the logfile or fail:
195 $fp = fopen($logfile, "a");
199 echo (" <title>Internal Script Error</title>
202 <div class=\"title\">
203 <h1><a href=\"http://www.privoxy.org/\">Privoxy</a>: Internal Script Error</h1>
206 <div class=\"warning\">
208 This script was unable to open its logfile.
211 Please <a href=\"mailto:info@privoxy.org?SUBJECT=Feedback-Script-Broken\">mail its owner</a>!
222 * Write Head (type, severity, user, client-ip)
225 fwrite($fp, "\n#FEEDBACK ID $item_id TYPE $problem SEVERITY $severity FROM $name ON $REMOTE_ADDR VERIFIED $url_confirmed TIME " . date("r") ."\n");
228 $lines = explode("\n", $remarks);
229 foreach ($lines as $line)
231 fwrite($fp, "#MASTER# REMARKS: $line\n");
237 * Depending on the type of problem reported,
238 * we need to write additional data:
243 * Banner not blocked:
246 fwrite($fp, "#MASTER# BLOCK-REFERRER: $referrer_url\n");
247 if (isset($num_images))
249 for($i=0; $i < $num_images; $i++)
251 if (isset($block_image[$i]))
253 fwrite($fp, "#MASTER# BLOCK-URL: $image_url[$i]\n");
254 $trackertext .= "Block image: $image_url[$i]\n\n";
258 if (isset($manual_image_url) && ($manual_image_url != ""))
260 fwrite($fp, "#MASTER# BLOCK-URL: $manual_image_url\n");
261 $trackertext .= "Block image: $manual_image_url\n\n";
266 * Innocent image blocked:
269 fwrite($fp, "#MASTER# UNBLOCK-REFERRER: $referrer_url\n");
270 if (isset($image_url) && ($image_url != ""))
272 fwrite($fp, "#MASTER# UNBLOCK-URL: $image_url\n");
273 $trackertext .= "Unblock image: $image_url\n\n";
278 * All other problems:
281 fwrite($fp, "#MASTER# PROBLEM-URL: $referrer_url\n");
288 * Notify our SF tracker that new data is waiting to be
293 case "P1": $category_id="412811"; $summary = "Ad not blocked "; break;
294 case "P2": $category_id="412810"; $summary = "Image blocked ";break;
295 case "P3": $category_id="412812"; $summary = "Page blocked ";break;
296 case "P4": $category_id="412813"; $summary = "Popups blocked ";break;
297 case "P5": $category_id="412814"; $summary = "Other problem ";break;
298 default: $category_id="412814"; $summary = "IMPOSSIBLE ";break;
301 $summary .= "on " . $referrer_url . " (" .$item_id . ")";
302 $priority = 3 * $severity;
304 $details = urlencode("On " . date("r") . " new data was received from $name:\n\n"
305 ."URL: $referrer_url\n\n$trackertext\nRemarks:\n$remarks");
307 $postfields = ( "group_id=11118&atid=460288&func=postadd&category_id=$category_id&artifact_group_id=195890" .
308 "&priority=$priority&summary=$summary&details=$details" );
310 $ch = curl_init ("http://sourceforge.net/tracker/index.php");
311 curl_setopt($ch, CURLOPT_HEADER, 0);
312 curl_setopt($ch, CURLOPT_FAILONERROR, 1);
313 curl_setopt($ch, CURLOPT_TIMEOUT, 20);
314 curl_setopt($ch, CURLOPT_POST, 1);
315 curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
325 <title>Privoxy Action List Feedback - Result</title>
331 <a href="http://www.privoxy.org" target="_blank">Privoxy</a> Action List Feedback - Result
337 <b>Thank you very much for taking the time to submit your feedback!</b>
341 The developers will review and use your submission to improve the
342 distribution actions file.
346 <input type="submit" value="Close this window" onclick="window.close();">
351 <p>Valid <a href="http://validator.w3.org/">HTML 4.01 Transitional</a></p>