X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=doc%2Fwebserver%2Factions%2Fstep3.php;h=e75678cebc41344a6f35a70d27331b007ab4c103;hb=60cbbc5f5d7514135bc5afc02d24e77a231c47f4;hp=beb84e6b48787ea15dfbf174a85aae74f185bdae;hpb=d9c1527acf72a0e83fe3dccaf2fe8467b41a5e49;p=privoxy.git diff --git a/doc/webserver/actions/step3.php b/doc/webserver/actions/step3.php index beb84e6b..e75678ce 100644 --- a/doc/webserver/actions/step3.php +++ b/doc/webserver/actions/step3.php @@ -1,173 +1,354 @@ + + + + + + + + + + Privoxy: $title + + +
+

+ Privoxy: $title +

+
+
+
+ $message +
+
+

Valid HTML 4.01 Transitional

+ + \n"); + exit; +} + /* * Cannot start with step 3: */ if (!isset($referrer_url)) { - echo ("Invalid Feedback Submission - - -

Invalid Feedback Submission

-

When submitting your feedback please start with - step 1.

- - "); - exit; + 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."); } + /* * Handle optional text fields: */ -if (!isset($name)) +if (!isset($name) || ($name == "")) { $name = "anonymous"; } +/* + * Assign unique ID: + */ +$item_id = date("U"); + + /* - * Open the logfile: + * Open the logfile or fail: */ -$logfile = "feedback-data.txt"; $fp = fopen($logfile, "a"); if(!$fp) { - echo ("Internal Script Error - - -

Internal Script Error

-

This script was unable to open its logfile.

-

Please mail its owner!

- + echo (" Internal Script Error + + +
+

Privoxy: Internal Script Error

+
+
+
+

+ This script was unable to open its logfile. +

+

+ Please mail its owner! +

+
+
+ "); exit; } + /* - * Write Head and remarks field: + * Write Head (type, severity, user, client-ip) + * and remarks field: */ -fwrite($fp, "#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); foreach ($lines as $line) { - fwrite($fp, "#REMARKS: $line\n"); + fwrite($fp, "#MASTER# REMARKS: $line\n"); } } + /* * Depending on the type of problem reported, * we need to write additional data: */ switch ($problem) { + /* + * Banner not blocked: + */ case "P1": - fwrite($fp, "#BLOCK-REFERRER: $referrer_url\n"); + fwrite($fp, "#MASTER# BLOCK-REFERRER: $referrer_url\n"); if (isset($num_images)) { for($i=0; $i < $num_images; $i++) { if (isset($block_image[$i])) { - fwrite($fp, "#BLOCK-URL: $image_url[$i]\n"); + fwrite($fp, "#MASTER# 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"); + fwrite($fp, "#MASTER# BLOCK-URL: $manual_image_url\n"); + $trackertext .= "Block image: $manual_image_url\n\n"; } break; + /* + * Innocent image blocked: + */ case "P2": - fwrite($fp, "#UNBLOCK-REFERRER: $referrer_url\n"); - if (isset($manual_image_url) && ($manual_image_url != "")) + fwrite($fp, "#MASTER# UNBLOCK-REFERRER: $referrer_url\n"); + if (isset($image_url) && ($image_url != "")) { - fwrite($fp, "#UNBLOCK-URL: image_url\n"); + fwrite($fp, "#MASTER# UNBLOCK-URL: $image_url\n"); + $trackertext .= "Unblock image: $image_url\n\n"; } break; - + /* + * All other problems: + */ + default: + fwrite($fp, "#MASTER# PROBLEM-URL: $referrer_url\n"); + break; } 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 blocked ";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 - - + Privoxy Action List Feedback - Result + + + +
+

+ Privoxy Action List Feedback - Result +

+
-

Privoxy Action List Feedback - Result

+
+

+ Thank you very much for taking the time to submit your feedback! +

-

Thank you very much for taking the time to submit your feedback!

+

+ The developers will review and use your submission to improve the + distribution actions file. +

+ +

+ +

-

It will be reviewed by the developers and used to improve the -distribution actions file.

+
- +

Valid HTML 4.01 Transitional

- +