X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=doc%2Fwebserver%2Factions%2Fstep3.php;h=d3b60686b24a2e46f7cc60d3497fc94f56d6cc3f;hb=56e38dc0aae22a1b09359b04dfbf90952ab87569;hp=906845b4045da6e880aaea2e275812173ba94cb5;hpb=273aaf5afed7e955586373e2e70fd23e29ce1514;p=privoxy.git diff --git a/doc/webserver/actions/step3.php b/doc/webserver/actions/step3.php index 906845b4..d3b60686 100644 --- a/doc/webserver/actions/step3.php +++ b/doc/webserver/actions/step3.php @@ -8,15 +8,63 @@ This file belongs in ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/ - $Id: step3.php,v 1.1 2002/03/30 03:20:30 oes Exp $ + $Id: step3.php,v 1.15 2002/04/09 15:08:10 oes Exp $ $Log: step3.php,v $ + Revision 1.15 2002/04/09 15:08:10 oes + Restoring lost text change + + Revision 1.14 2002/04/08 17:04:05 oes + Adapt to unified stylesheet + + Revision 1.13 2002/04/07 17:11:40 oes + Tracker submit via curl (no need for user to see), fixing problems, removing monster comments + + Revision 1.12 2002/04/06 18:57:38 swa + first version of the script that writes the + logfile with all submissions and additionally + submits the entries to our tracker. + + Revision 1.11 2002/04/06 15:54:08 swa + prework: list of what needs to + be submitted to the tracker. + + Revision 1.10 2002/04/06 15:19:35 oes + Clean-up, smarter handling of unreachable URLs + + Revision 1.9 2002/04/06 11:34:44 oes + Cosmetics + + Revision 1.8 2002/04/04 19:48:11 oes + Reactivating the scripts ,-) + + Revision 1.7 2002/04/04 10:29:58 oes + Keeping feedback confidential + + Revision 1.6 2002/04/03 19:36:04 swa + consistent look + + Revision 1.5 2002/04/02 07:22:43 oes + Cosmetics + + Revision 1.4 2002/04/01 19:13:47 oes + Extended, fixed bugs, beefed up design, made IE-safe + + Revision 1.3 2002/03/30 20:44:46 swa + have consistent look and feel. part 2. + use correct urls. + + Revision 1.2 2002/03/30 19:49:34 swa + have consistent look and feel + Revision 1.1 2002/03/30 03:20:30 oes Added Feedback mechanism for actions file - Written by and Copyright (C) 2002 the SourceForge - Privoxy team. http://www.privoxy.org/ + Copyright (C) 2002 the SourceForge Privoxy team. + http://www.privoxy.org/ + + Written by Andreas Oesterhelt This program is free software; you can redistribute it and/or modify it under the terms of the GNU General @@ -39,62 +87,82 @@ --> - + + + + Invalid Feedback Submission + if ($title == "invalid") /* shortcut */ + { + $title = "Invalid Feedback Submission"; + } + + echo (" Privoxy: $title -
Invalid Feedback Submission
-
-
- When submitting your feedback please start with step 1. +
+

+ Privoxy: $title +

-
+
+
+ $message +
+
+

Valid HTML 4.01 Transitional

- "); + \n"); exit; } +/* + * Cannot start with step 3: + */ +if (!isset($referrer_url)) +{ + error_abort("invalid", "When submitting your feedback please start with step 1."); +} + + /* * Cannot work on unknown problem: */ if (!isset($problem)) { - echo (" Invalid Feedback Submission - - -
Invalid Feedback Submission
-
-
- You need to select the nature of the problem in step 1. -
-
- - "); - exit; + error_abort("invalid", "You need to select the nature of the problem in step 1."); +} + + +/* + * Don't accept unconfirmed URLs + */ +if (!isset($url_confirmed)) +{ + error_abort("invalid", "When submitting URLs that this script can't retrieve, you need to check \"Yes, I'm sure\" + step 2."); } @@ -106,11 +174,15 @@ if (!isset($name) || ($name == "")) $name = "anonymous"; } +/* + * Assign unique ID: + */ +$item_id = date("U"); + /* * Open the logfile or fail: */ -$logfile = "feedback-data.txt"; $fp = fopen($logfile, "a"); if(!$fp) @@ -118,9 +190,11 @@ if(!$fp) echo (" Internal Script Error -
Internal Script Error
-
-
+
+

Privoxy: Internal Script Error

+
+
+

This script was unable to open its logfile.

@@ -128,7 +202,7 @@ if(!$fp) Please mail its owner!

-
+ "); exit; @@ -139,7 +213,7 @@ if(!$fp) * Write Head (type, severity, user, client-ip) * and remarks field: */ -fwrite($fp, "\n#FEEDBACK TYPE $problem SEVERITY $severity FROM $name ON $REMOTE_ADDR\n"); +fwrite($fp, "\n#FEEDBACK ID $item_id TYPE $problem SEVERITY $severity FROM $name ON $REMOTE_ADDR VERIFIED $url_confirmed TIME " . date("r") ."\n"); if (isset($remarks)) { $lines = explode("\n", $remarks); @@ -168,12 +242,14 @@ switch ($problem) if (isset($block_image[$i])) { fwrite($fp, "#BLOCK-URL: $image_url[$i]\n"); + $trackertext .= "Block image: $image_url[$i]\n\n"; } } } if (isset($manual_image_url) && ($manual_image_url != "")) { fwrite($fp, "#BLOCK-URL: $manual_image_url\n"); + $trackertext .= "Block image: $manual_image_url\n\n"; } break; @@ -185,6 +261,7 @@ switch ($problem) if (isset($image_url) && ($image_url != "")) { fwrite($fp, "#UNBLOCK-URL: $image_url\n"); + $trackertext .= "Unblock image: $image_url\n\n"; } break; @@ -198,6 +275,42 @@ switch ($problem) fclose($fp); +/* + * Notify our SF tracker that new data is waiting to be + * processed + */ +switch($problem) +{ + case "P1": $category_id="412811"; $summary = "Ad not blocked "; break; + case "P2": $category_id="412810"; $summary = "Image blocked ";break; + case "P3": $category_id="412812"; $summary = "Page plocked ";break; + case "P4": $category_id="412813"; $summary = "Popups blocked ";break; + case "P5": $category_id="412814"; $summary = "Other problem ";break; + default: $category_id="412814"; $summary = "IMPOSSIBLE ";break; +} + +$summary .= "on " . $referrer_url . " (" .$item_id . ")"; +$priority = 3 * $severity; + +$details = urlencode("On " . date("r") . " new data was received from $name:\n\n" + ."URL: $referrer_url\n\n$trackertext\nRemarks:\n$remarks"); + +$postfields = ( "group_id=11118&atid=460288&func=postadd&category_id=$category_id&artifact_group_id=195890" . + "&priority=$priority&summary=$summary&details=$details" ); + +$ch = curl_init ("http://sourceforge.net/tracker/index.php"); +curl_setopt($ch, CURLOPT_HEADER, 0); +curl_setopt($ch, CURLOPT_FAILONERROR, 1); +curl_setopt($ch, CURLOPT_TIMEOUT, 20); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); + +ob_start(); +curl_exec($ch); +ob_end_clean(); + +curl_close ($ch); + ?> Privoxy Action List Feedback - Result @@ -205,7 +318,9 @@ fclose($fp);
- Privoxy Action List Feedback - Result +

+ Privoxy Action List Feedback - Result +

@@ -214,7 +329,7 @@ fclose($fp);

- It will be reviewed by the developers and used to improve the + The developers will review and use your submission to improve the distribution actions file.

@@ -223,5 +338,8 @@ fclose($fp);

+ +

Valid HTML 4.01 Transitional

+