[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squirrelmail-cvs
Subject:    [SM-CVS] CVS: squirrelmail/plugins/spamcop options.php,1.16,1.17 setup.php,1.13,1.14
From:       Tomas Kuliavas <tokul () users ! sourceforge ! net>
Date:       2003-11-24 18:02:04
[Download RAW message or body]

Update of /cvsroot/squirrelmail/squirrelmail/plugins/spamcop
In directory sc8-pr-cvs1:/tmp/cvs-serv11328

Modified Files:
	options.php setup.php 
Log Message:
disables quick reporting feature by default. This is not documented 
spamcop feature. See bug. 809452


Index: options.php
===================================================================
RCS file: /cvsroot/squirrelmail/squirrelmail/plugins/spamcop/options.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -r1.16 -r1.17
--- options.php	27 Oct 2003 22:24:40 -0000	1.16
+++ options.php	24 Nov 2003 18:02:01 -0000	1.17
@@ -64,7 +64,7 @@
         break;
 }
 
-global $spamcop_enabled, $spamcop_delete;
+global $spamcop_enabled, $spamcop_delete, $spamcop_quick_report;
 spamcop_load();
 
 ?>
@@ -97,12 +97,14 @@
 	  <form method="post" action="options.php">
 	  <td>
 	    <select name="meth">
-	      <option value="quick_email"
 		<?php
+		    if ($spamcop_quick_report) {
+			echo '<option value="quick_email"';
 	          if ($spamcop_method == 'quick_email') echo ' selected';
 	          echo ">"._("Quick email-based reporting");
+			echo '</option>';
+		    }
 		?>
-	      </option>
 	      <option value="thorough_email"
 		<?php
 	    	  if ($spamcop_method == 'thorough_email') echo ' selected';
@@ -153,9 +155,11 @@
 echo _("Pressing the button forwards the message to the SpamCop service and will \
optionally delete the message.  From there, you just need to go to your INBOX and \
quite soon a message should appear from SpamCop.  (It gets sent to the account you \
registered with, so make sure that your mail forwarder works!) Open it up, click on \
the appropriate link at the top, and a new browser window will open.");  echo "</p>";
 
+if ($spamcop_quick_report) {
 echo "<p>";
 echo _("Currently, the quick reporting just forwards the request to the thorough \
reporting.  Also, it appears that this is for members (non-free) only. Hopefully this \
will change soon.");  echo "</p>\n";
+}
 
 echo "<p><b>" . _("Web-based Reporting") . "</b><br />";
 echo _("When you press the button on the confirmation page, this will pop open a new \
browser window and the SpamCop service should appear inside. The message will not be \
deleted (working on that part), but you won't need to wait for a response email to \
start the spam reporting.");

Index: setup.php
===================================================================
RCS file: /cvsroot/squirrelmail/squirrelmail/plugins/spamcop/setup.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -r1.13 -r1.14
--- setup.php	17 Nov 2003 18:26:55 -0000	1.13
+++ setup.php	24 Nov 2003 18:02:02 -0000	1.14
@@ -13,6 +13,8 @@
 /** @ignore */
 require_once(SM_PATH . 'functions/global.php');
 
+/** Disable Quick Reporting by default */
+$spamcop_quick_report = false;
 
 /** Initialize the plugin */
 function squirrelmail_plugin_init_spamcop() {
@@ -39,17 +41,24 @@
 // Validate some of it (make '' into 'default', etc.)
 function spamcop_load() {
    global $username, $data_dir, $spamcop_enabled, $spamcop_delete,
-      $spamcop_method, $spamcop_id;
+      $spamcop_method, $spamcop_id, $spamcop_quick_report;
 
    $spamcop_enabled = getPref($data_dir, $username, 'spamcop_enabled');
    $spamcop_delete = getPref($data_dir, $username, 'spamcop_delete');
    $spamcop_method = getPref($data_dir, $username, 'spamcop_method');
    $spamcop_id = getPref($data_dir, $username, 'spamcop_id');
    if ($spamcop_method == '') {
-      if (getPref($data_dir, $username, 'spamcop_form'))
+// This variable is not used
+//      if (getPref($data_dir, $username, 'spamcop_form'))
+//         $spamcop_method = 'web_form';
+//      else
+
+// Default to web_form. It is faster.
+	$spamcop_method = 'web_form';
+	setPref($data_dir, $username, 'spamcop_method', $spamcop_method);
+    }
+   if (! $spamcop_quick_report && $spamcop_method=='quick_email') {
          $spamcop_method = 'web_form';
-      else
-         $spamcop_method = 'thorough_email';
       setPref($data_dir, $username, 'spamcop_method', $spamcop_method);
    }
    if ($spamcop_id == '')
@@ -59,7 +68,7 @@
 
 // Show the link on the read-a-message screen
 function spamcop_show_link() {
-   global $spamcop_enabled, $spamcop_method;
+   global $spamcop_enabled, $spamcop_method, $spamcop_quick_report;
 
    if (! $spamcop_enabled)
       return;
@@ -72,6 +81,15 @@
 
    echo "<br>\n";
    
+    /* 
+       Catch situation when user use quick_email and does not update 
+       preferences. User gets web_form link. If prefs are set to 
+       quick_email format - they will be updated after clicking the link
+     */
+    if (! $spamcop_quick_report && $spamcop_method=='quick_email') {
+	$spamcop_method = 'web_form';
+    }
+   
    if ($spamcop_method == 'web_form') {
 ?><script language="javascript" type="text/javascript">
 document.write('<a href="../plugins/spamcop/spamcop.php?passed_id=<?PHP echo \
urlencode($passed_id); ?>&amp;js_web=1&amp;mailbox=<?PHP echo urlencode($mailbox); \
?>" target="_blank">');



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
--
squirrelmail-cvs mailing list
List Address: squirrelmail-cvs@lists.sourceforge.net
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
http://squirrelmail.org/cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic