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.11 2002/04/06 15:54:08 swa Exp $
14 Revision 1.11 2002/04/06 15:54:08 swa
15 prework: list of what needs to
16 be submitted to the tracker.
18 Revision 1.10 2002/04/06 15:19:35 oes
19 Clean-up, smarter handling of unreachable URLs
21 Revision 1.5 2002/04/02 07:22:43 oes
24 Revision 1.4 2002/04/01 19:13:47 oes
25 Extended, fixed bugs, beefed up design, made IE-safe
27 Revision 1.1 2002/03/30 03:20:30 oes
28 Added Feedback mechanism for actions file
31 Written by and Copyright (C) 2002 the SourceForge
32 Privoxy team. http://www.privoxy.org/
34 This program is free software; you can redistribute it
35 and/or modify it under the terms of the GNU General
36 Public License as published by the Free Software
37 Foundation; either version 2 of the License, or (at
38 your option) any later version.
40 This program is distributed in the hope that it will
41 be useful, but WITHOUT ANY WARRANTY; without even the
42 implied warranty of MERCHANTABILITY or FITNESS FOR A
43 PARTICULAR PURPOSE. See the GNU General Public
44 License for more details.
46 The GNU General Public License should be included with
47 this file. If not, you can view it at
48 http://www.gnu.org/copyleft/gpl.html
49 or write to the Free Software Foundation, Inc., 59
50 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
55 <meta http-equiv="Content-Style-Type" content="text/css">
56 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
57 <link rel="stylesheet" type="text/css" href="../p_feedback.css">
65 $logfile = "results/actions-feedback.txt";
72 //error_reporting(E_ALL);
73 error_reporting(E_NONE);
76 // $referrer_url="http://informer2.comdirect.de/de/my/homepage/index.html?Show=main.html&callerPage=%2fde%2fmy%2fhomepage%2findex.html";
78 // $url_confirmed="yes";
80 // $remarks="this is the first line of text\nthe 2nd line\nthird line.";
83 // $manual_image_url="http://www.someimage.de/de/my/homepage/index.html?Show=main.html&callerPage=%2fde%2fmy%2fhomepage%2findex.html";
84 // $image_url="http://www.someimage.de/de/my/homepage/index.html?Show=main.html&callerPage=%2fde%2fmy%2fhomepage%2findex.html";
85 // // end debug short cut
88 * Function: error_abort
89 * Purpose: Return an error page with $title and $message
91 function error_abort($title, $message)
93 if ($title == "invalid") /* shortcut */
95 $title = "Invalid Feedback Submission";
98 echo (" <title>Privoxy: $title</title>
101 <div class=\"title\">
103 <a href=\"http://www.privoxy.org/\">Privoxy</a>: $title
107 <div class=\"errorbox\">
111 <p>Valid <a href=\"http://validator.w3.org/\">HTML 4.01 Transitional</a></p>
119 * Cannot start with step 3:
121 if (!isset($referrer_url))
123 error_abort("invalid", "When submitting your feedback please start with <a href=\"index.php\">step 1</a>.");
128 * Cannot work on unknown problem:
130 if (!isset($problem))
132 error_abort("invalid", "You need to select the nature of the problem in <a href=\"index.php\">step 1</a>.");
137 * Don't accept unconfirmed URLs
139 if (!isset($url_confirmed))
141 error_abort("invalid", "When submitting URLs that this script can't retrieve, you need to check \"Yes, I'm sure\"
142 <a href=\"javascript:history.back();\">step 2</a>.");
147 * Handle optional text fields:
149 if (!isset($name) || ($name == ""))
156 * Open the logfile or fail:
158 $fp = fopen($logfile, "a");
162 echo (" <title>Internal Script Error</title>
165 <div class=\"title\">
166 <h1><a href=\"http://www.privoxy.org/\">Privoxy</a>: Internal Script Error</h1>
169 <div class=\"errorbox\">
171 This script was unable to open its logfile.
174 Please <a href=\"mailto:info@privoxy.org?SUBJECT=Feedback-Script-Broken\">mail its owner</a>!
185 * Write Head (type, severity, user, client-ip)
188 fwrite($fp, "\n#FEEDBACK TYPE $problem SEVERITY $severity FROM $name ON $REMOTE_ADDR VERIFIED $url_verified TIME " . date("r") ."\n");
191 $lines = explode("\n", $remarks);
192 foreach ($lines as $line)
194 fwrite($fp, "#REMARKS: $line\n");
200 * Depending on the type of problem reported,
201 * we need to write additional data:
206 * Banner not blocked:
209 fwrite($fp, "#BLOCK-REFERRER: $referrer_url\n");
210 if (isset($num_images))
212 for($i=0; $i < $num_images; $i++)
214 if (isset($block_image[$i]))
216 fwrite($fp, "#BLOCK-URL: $image_url[$i]\n");
220 if (isset($manual_image_url) && ($manual_image_url != ""))
222 fwrite($fp, "#BLOCK-URL: $manual_image_url\n");
227 * Innocent image blocked:
230 fwrite($fp, "#UNBLOCK-REFERRER: $referrer_url\n");
231 if (isset($image_url) && ($image_url != ""))
233 fwrite($fp, "#UNBLOCK-URL: $image_url\n");
238 * All other problems:
241 fwrite($fp, "#PROBLEM-URL: $referrer_url\n");
247 // now fill the tracker on sf with all the necessary values:
249 // <FORM ACTION="/tracker/index.php?group_id=11118&atid=460288" METHOD="POST" enctype="multipart/form-data">
250 // <INPUT TYPE="HIDDEN" NAME="func" VALUE="postadd">
252 // <SELECT NAME="category_id">
253 // <OPTION VALUE="100">None</OPTION>
254 // <OPTION VALUE="412811">filter: ad-incorrectly-blocked</OPTION>
255 // <OPTION VALUE="412810">filter: ad-not-blocked</OPTION>
256 // <OPTION VALUE="412814">filter: other problem</OPTION>
257 // <OPTION VALUE="412812">filter: page-incorrectly-block</OPTION>
258 // <OPTION VALUE="412813">filter: popups-incorrectly blo</OPTION>
260 // <SELECT NAME="artifact_group_id">
261 // <OPTION VALUE="100">None</OPTION>
262 // <OPTION VALUE="195870">action file version 1.0</OPTION>
263 // <OPTION VALUE="195871">action file version 1.1</OPTION>
264 // <OPTION VALUE="195872">action file version 1.2</OPTION>
265 // <OPTION VALUE="195873">action file version 1.3</OPTION>
266 // <OPTION VALUE="195874">action file version 1.4</OPTION>
267 // <OPTION VALUE="195875">action file version 1.5</OPTION>
268 // <OPTION VALUE="195876">action file version 1.6</OPTION>
269 // <OPTION VALUE="195877">action file version 1.7</OPTION>
270 // <OPTION VALUE="195878">action file version 1.8</OPTION>
271 // <OPTION VALUE="195879">action file version 1.9</OPTION>
272 // <OPTION VALUE="195880">action file version 2.0</OPTION>
274 // <SELECT NAME="assigned_to">
275 // <OPTION VALUE="100">None</OPTION>
276 // <OPTION VALUE="128588">bart1803</OPTION>
277 // <OPTION VALUE="249980">david__schmidt</OPTION>
278 // <OPTION VALUE="79346">gliptak</OPTION>
279 // <OPTION VALUE="322640">hal9</OPTION>
280 // <OPTION VALUE="108873">joergs</OPTION>
281 // <OPTION VALUE="199289">jongfoster</OPTION>
282 // <OPTION VALUE="10857">morcego</OPTION>
283 // <OPTION VALUE="78811">oes</OPTION>
284 // <OPTION VALUE="43129">roro</OPTION>
285 // <OPTION VALUE="249832">steudten</OPTION>
286 // <OPTION VALUE="74317">swa</OPTION>
288 // <SELECT NAME="priority">
289 // <OPTION VALUE="1">1 - Lowest</OPTION>
290 // <OPTION VALUE="2">2</OPTION>
291 // <OPTION VALUE="3">3</OPTION>
292 // <OPTION VALUE="4">4</OPTION>
293 // <OPTION VALUE="5" SELECTED>5 - Medium</OPTION>
294 // <OPTION VALUE="6">6</OPTION>
295 // <OPTION VALUE="7">7</OPTION>
296 // <OPTION VALUE="8">8</OPTION>
297 // <OPTION VALUE="9">9 - Highest</OPTION>
299 // <INPUT TYPE="TEXT" NAME="summary" SIZE="35" MAXLENGTH="40">
301 // we can either put everything in here (nicely formatted) ..
302 // <TEXTAREA NAME="details" ROWS="30" COLS="55" WRAP="HARD"></TEXTAREA>
304 // ... or attach a file (with the html header so it gets displayed
305 // as if it is a html file
306 // <input type="checkbox" name="add_file" VALUE="1">
307 // <input type="file" name="input_file" size="30">
308 // <input type="text" name="file_description" size="40" maxlength="255">
310 // <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="SUBMIT">
313 // TODO: - set all variables above this point
314 // - evaluate alternative: file attachment
318 // below this point, all variables _must_ be set (no checking is performed)
321 // need to switch the following statement for type of problem
324 case "P1": $sf_cat_id="412811"; $sf_summary="an advertisment was not blocked"; break;
325 case "P2": $sf_cat_id="412810"; $sf_summary="an innocent image was blocked"; break;
326 case "P3": $sf_cat_id="412812"; $sf_summary="the whole page was erraneously blocked"; break;
327 case "P4": $sf_cat_id="412813"; $sf_summary="the page needs popups but they don't work"; break;
328 case "P5": $sf_cat_id="412814"; $sf_summary="a problem occured"; break;
329 default: $sf_cat_id="412814"; $sf_summary="AN UNPROCESSABLE PROBLEM OCCURED"; break;
331 // need to switch the following statement for action file version
332 $sf_agroup_id="195870"; // assume 1.0 for the time being
333 // this is always set to nobody
334 $sf_assigned_to="100";
335 // need to set values from [1...9]
338 case "1": $sf_prio="1"; break; // low
339 case "2": $sf_prio="5"; break; // medium
340 case "3": $sf_prio="9"; break; // high
341 default: $sf_cat_id="1"; break;
343 // here comes the beef
344 $sf_trackertext="\n\n\nIt would be awesome if the links below were clickable :-)\n\n";
345 $sf_trackertext=$sf_trackertext . "This item was submitted by $name\n\n";
346 $sf_trackertext=$sf_trackertext . "Where did it happen?\n$referrer_url\n\n";
347 $sf_trackertext=$sf_trackertext . "What happened?\n$sf_summary (" . date("r") . ")\n\n";
351 $sf_trackertext=$sf_trackertext."These URLs are likely advertisements\n";
352 for($i=0; $i < $num_images; $i++)
354 if (isset($block_image[$i]))
356 $sf_trackertext = $sf_trackertext . "$image_url[$i]\n\n";
359 if ($manual_image_url != "")
361 $sf_trackertext=$sf_trackertext . "$manual_image_url";
363 $sf_trackertext= $sf_trackertext . "\n\n";
365 case "P2": $sf_trackertext= $sf_trackertext . "The URL of the image that was incorrectly blocked:\n$image_url\n\n"; break;
366 case "P3": $sf_trackertext= $sf_trackertext . "\n\n"; break;
367 case "P4": $sf_trackertext= $sf_trackertext . "\n\n"; break;
368 case "P5": $sf_trackertext= $sf_trackertext . "\n\n"; break;
369 default: $sf_trackertext= $sf_trackertext . "\n\n"; break; break;
371 $sf_trackertext= $sf_trackertext . "Remarks:\n--------\n$remarks\n\n\n";
377 <a href="http://www.privoxy.org" target="_blank">Privoxy</a> Action List Feedback - Step 3 of 4.
384 Thank you. We have preliminary validated you input. Please click on "Submit"
385 to transfer you feedback to our tracker.
388 <form action="http://sourceforge.net/tracker/index.php?group_id=11118&atid=460288" method="post" enctype="multipart/form-data">
389 <input type="hidden" name="func" value="postadd">
390 <input type="hidden" name="category_id" value="<?php echo ($sf_cat_id) ?>">
391 <input type="hidden" name="artifact_group_id" value="<?php echo ($sf_agroup_id) ?>">
392 <input type="hidden" name="assigned_to" value="<?php echo ($sf_assigned_to) ?>">
393 <input type="hidden" name="priority" value="<?php echo ($sf_prio) ?>">
394 <input type="hidden" name="summary" value="<?php echo ($sf_summary) ?>">
395 <input type="hidden" name="details" value="<?php echo ($sf_trackertext) ?>">
396 <input type="submit" name="submit" value="Submit">
398 The script will take you to Sourceforge where all submissions are collected.
401 <p>Valid <a href="http://validator.w3.org/">HTML 4.01 Transitional</a></p>
407 <title>Privoxy Action List Feedback - Result</title>
413 <a href="http://www.privoxy.org" target="_blank">Privoxy</a> Action List Feedback - Result
419 <b>Thank you very much for taking the time to submit your feedback!</b>
423 It will be reviewed by the developers and used to improve the
424 distribution actions file.
428 <input type="submit" value="Close this window" onclick="window.close();">
433 <p>Valid <a href="http://validator.w3.org/">HTML 4.01 Transitional</a></p>