From acfe700ddafd7570cd1475629a45d1146e521549 Mon Sep 17 00:00:00 2001 From: oes Date: Sat, 30 Mar 2002 03:20:30 +0000 Subject: [PATCH] Added Feedback mechanism for actions file --- doc/webserver/actions/index.php | 145 +++++++++++++++++++ doc/webserver/actions/step2.php | 237 ++++++++++++++++++++++++++++++++ doc/webserver/actions/step3.php | 164 ++++++++++++++++++++++ 3 files changed, 546 insertions(+) create mode 100755 doc/webserver/actions/index.php create mode 100644 doc/webserver/actions/step2.php create mode 100644 doc/webserver/actions/step3.php diff --git a/doc/webserver/actions/index.php b/doc/webserver/actions/index.php new file mode 100755 index 00000000..26d52011 --- /dev/null +++ b/doc/webserver/actions/index.php @@ -0,0 +1,145 @@ +Invalid Privoxy Action List Feedback +

Invalid Feedback Submission

+

You are either not using Privoxy at all, or using an + actions file which is not based on the recent + distribution actions file (version $current_actions_file_version).

+

As much as we welcome your feedback, we are unable to process + input for the actions file if not based on our distribution. Sorry.

+

You can download the latest version of + Privoxy here.

+ + "); + exit; +} + +?> + + + + Privoxy Action List Feedback - Step 1 of 2 + + + +

Privoxy Action List Feedback - Step 1 of 2

+ +

+Thank you for reporting a missing or invalid action! +

+

+Please fill the below form and click to +proceed to Step 2. +

+ +
+ + + + + + + + + + + + + + + + + + + +
URL: + +
Nature of the problem: + +
+ +
+
+

+ +

To faciliate your feedback, you can bookmark this bookmarklet
(right-click and select "File Bookmark for link"). +
Used on a page that you want to report on, it will take you here and pre-fill the URL field. +

+ + + diff --git a/doc/webserver/actions/step2.php b/doc/webserver/actions/step2.php new file mode 100644 index 00000000..f0dcd18f --- /dev/null +++ b/doc/webserver/actions/step2.php @@ -0,0 +1,237 @@ +Invalid Feedback Submission +

Invalid Feedback Submission

+

When submitting your feedback please start with + step 1.

+ + "); + exit; +} + +/* + * Cannot work on unknown problem: + */ +if (!isset($problem) || $problem == "INVALID") +{ + echo ("Invalid Feedback Submission +

Invalid Feedback Submission

+

You need to select the nature of the problem in + step 1.

+ + "); + exit; +} + + +/* + * Check if URL really exists and buffer its contents: + */ + +$ch = curl_init ($referrer_url); +curl_setopt ($ch, CURLOPT_HEADER, 0); +curl_setopt ($ch, CURLOPT_FAILONERROR, 1); + +ob_start(); +$success = curl_exec ($ch); +$page = ob_get_contents(); +ob_end_clean(); + +curl_close ($ch); + +if (!$success) +{ + echo ("Invalid Feedback Submission +

Invalid Feedback Submission

+

The URL that you entered ($referrer_url) +
could not be retrieved.

+

Make sure the URL is correct and publicly accessible.

+

Back to step 1

+ + + "); + exit; +} + +/* + * Create description from problem code: + */ +switch($problem) +{ + case "P1": $problem_description="an advertisment was not blocked"; break; + case "P2": $problem_description="an innocent image was blocked"; break; + case "P3": $problem_description="the whole page was erraneously blocked"; break; + case "P4": $problem_description="the page needs popups but they don't work"; break; + case "P5": $problem_description="a problem occured"; break; + default: $problem_description="AN UNPROCESSABLE PROBLEM OCCURED"; +} + +?> + + + + Privoxy Action List Feedback - Step 2 of 2 + + + +

Privoxy Action List Feedback - Step 2 of 2

+

+You are about to report that +
on . +

+ + +

+

+ + + + +
+ +]*?src=[\'"]?(.*?)[\'" >]|i', $page, $matches); + $count = count($matches[0]); + if ($count > 0) + { + $referrer_base = substr($referrer_url, 0, -strpos(strrev($referrer_url), '/')); + $referrer_host = "http://".strrev(strrchr(strrev(substr($referrer_url, 7)), "/")); + + echo ("
Choose the images to be blocked from the following list:

\n"); + echo ("\n"); + echo ("\n"); + for ($i=0; $i< $count; $i++) { + $image_url = $matches[1][$i]; + if (strncmp("http://", $image_url, 7)) + { + if ($image_url{0} == "/") + { + $image_url = $referrer_host.$image_url; + } + else + { + $image_url = $referrer_base.$image_url; + } + } + echo ("\n"); + echo ("\n"); + echo ("\n"); + echo ("\n"); + } + echo ("
$image_url:

If the banner that you saw is not listed above, enter the URL here\n"); + } + else + { + echo ("
URL of the advertisment image:\n"); + } +} + +?> + +
Hint: right-click the image, select "Copy image location" and paste the URL here.
+
+

+
+") ?> + + +
URL of the innocent image: +
Hint: right-click the image, select "Copy image location" and paste the URL here. +
This may not work if the image was blocked by size or if +image-blocker is set to redirect.
+
+

+
+") ?> + + +
Severity:
+
+

+ +

+
+ +
Remarks: (optional)
+
+

+
+ +
Your Name: (optional)
+
+

+
+ +
 
+
+ +
+ +
+
+

+ + + diff --git a/doc/webserver/actions/step3.php b/doc/webserver/actions/step3.php new file mode 100644 index 00000000..57059969 --- /dev/null +++ b/doc/webserver/actions/step3.php @@ -0,0 +1,164 @@ +Invalid Feedback Submission +

Invalid Feedback Submission

+

When submitting your feedback please start with + step 1.

+ + "); + exit; +} + +/* + * 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; +} + +/* + * Handle optional text fields: + */ +if (!isset($name)) +{ + $name = "anonymous"; +} + +/* + * Open the logfile: + */ +$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!

+ + "); + exit; +} + +/* + * Write Head and remarks field: + */ +fwrite($fp, "#FEEDBACK TYPE $problem SEVERITY $severity FROM $name ON $REMOTE_ADDR\n"); +if (isset($remarks)) +{ + $lines = explode("\n", $remarks); + foreach ($lines as $line) + { + fwrite($fp, "#REMARKS: $line\n"); + } +} + +/* + * Depending on the type of problem reported, + * we need to write additional data: + */ +switch ($problem) +{ + case "P1": + fwrite($fp, "#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"); + } + } + } + if (isset($manual_image_url) && ($manual_image_url != "")) + { + fwrite($fp, "#BLOCK-URL: $manual_image_url\n"); + } + break; + + case "P2": + fwrite($fp, "#UNBLOCK-REFERRER: $referrer_url\n"); + if (isset($manual_image_url) && ($manual_image_url != "")) + { + fwrite($fp, "#UNBLOCK-URL: image_url\n"); + } + break; + + +} + +fclose($fp); + +?> + + + + Privoxy Action List Feedback - Result + + + +

Privoxy Action List Feedback - Result

+ +

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

+ +

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

+ + + + + -- 2.39.2