Source for file options.php

Documentation is available at options.php

  1. <?php
  2.  
  3. /**
  4.  * options.php -- SpamCop options page
  5.  *
  6.  * @copyright 1999-2020 The SquirrelMail Project Team
  7.  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  8.  * @version $Id: options.php 14845 2020-01-07 08:09:34Z pdontthink $
  9.  * @package plugins
  10.  * @subpackage spamcop
  11.  */
  12.  
  13.  
  14. /**
  15.  * Include the SquirrelMail initialization file.
  16.  */
  17. require('../../include/init.php');
  18. /* plugin functions */
  19. include_once(SM_PATH 'plugins/spamcop/functions.php');
  20.  
  21.  
  22. /** is spamcop plugin disabled */
  23. // option changes do nothing, if read_body_header_right hook is not active.
  24.  
  25. /* globals */
  26. sqgetGlobalVar('action'$action);
  27. sqgetGlobalVar('meth'$meth);
  28. sqgetGlobalVar('ID' $ID);
  29.  
  30. sqgetGlobalVar('username'$usernameSQ_SESSION);
  31. /* end of globals */
  32.  
  33. $action (!isset($action'' $action);
  34.  
  35. switch ($action{
  36.     case 'enable':
  37.         setPref($data_dir$username'spamcop_enabled'1);
  38.         break;
  39.     case 'disable':
  40.         setPref($data_dir$username'spamcop_enabled''');
  41.         break;
  42.     case 'save':
  43.         setPref($data_dir$username'spamcop_delete''');
  44.         break;
  45.     case 'delete':
  46.         setPref($data_dir$username'spamcop_delete'1);
  47.         break;
  48.     case 'keep':
  49.         setPref($data_dir$username'spamcop_save'0);
  50.         break;
  51.     case 'dontkeep':
  52.         setPref($data_dir$username'spamcop_save'1);
  53.         break;
  54.     case 'meth':
  55.         if (isset($meth)) {
  56.             setPref($data_dir$username'spamcop_method'$meth);
  57.         }
  58.         break;
  59.     case 'save_id':
  60.         if (isset($ID)) {
  61.             $ID trim($ID);
  62.             $ID preg_replace('/@.*/','',$ID);
  63.             $ID preg_replace('/.*\./','',$ID);
  64.             setPref($data_dir$username'spamcop_id'$ID);
  65.         }
  66.         break;
  67. }
  68.  
  69. global $spamcop_enabled$spamcop_delete$spamcop_save$spamcop_quick_report;
  70. spamcop_load_function();
  71.  
  72. ?>
  73.       <br />
  74.       <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
  75.       <tr><td bgcolor="<?php echo $color[0]?>">
  76.         <div style="text-align: center;"><b>
  77.         <?php echo _("Options"" - " _("Spam reporting")?>
  78.         </b></div>
  79.       </td></tr></table>
  80.       <br />
  81.  
  82.       <table align="center">
  83.         <tr>
  84.           <?php
  85.             echo html_tag('td',_("SpamCop link is:"),'right');
  86.             echo html_tag('td'spamcop_enable_disable($spamcop_enabled,'disable','enable') );
  87.           ?>
  88.         </tr>
  89.         <tr>
  90.           <?php
  91.             echo html_tag('td',_("Delete spam when reported:""<br />\n" .
  92.             '<small>(' _("Only works with email-based reporting"')</small>',
  93.             'right','','valign="top"');
  94.             echo html_tag('td'spamcop_enable_disable($spamcop_delete,'save','delete'),'','','valign="top"');
  95.           ?>
  96.         </tr>
  97.         <tr>
  98.           <?php
  99.             echo html_tag('td',_("Save emails submitted to SpamCop:""<br />\n" .
  100.             '<small>(' _("Only works with email-based reporting"')</small>',
  101.             'right','','valign="top"');
  102.             echo html_tag('td'spamcop_enable_disable($spamcop_save,'keep','dontkeep'),'','','valign="top"');
  103.           ?>
  104.         </tr>
  105.         <tr>
  106.           <?php
  107.             echo html_tag('td',_("Spam Reporting Method:"),'right');
  108.           ?>
  109.           <td>
  110.           <form method="post" action="options.php">
  111.             <select name="meth">
  112.               <?php
  113.                 if ($spamcop_quick_report{
  114.                     echo '<option value="quick_email"';
  115.                     if ($spamcop_method == 'quick_email'echo ' selected="selected"';
  116.                     echo ">"._("Quick email-based reporting");
  117.                     echo '</option>';
  118.                 }
  119.             $selected '';
  120.             if ($spamcop_method == 'thorough_email'{
  121.                 $selected ' selected';
  122.             }
  123.             echo sprintf('          <option value="thorough_email"%s>%s</option>',$selected_("Through email-based reporting"));
  124.             
  125.             $selected '';
  126.             if ($spamcop_method == 'web_form'{
  127.                 $selected ' selected';
  128.             }
  129.             echo sprintf('          <option value="web_form"%s>%s</option>'$selected_("Web-based form"));
  130.                 
  131.             ?>
  132.             </select>
  133.             <input type="hidden" name="action" value="meth" />
  134.             <?php
  135.               echo '<input type="submit" value="' _("Save Method""\" />\n";
  136.             ?>
  137.           </form></td>
  138.         </tr>
  139.         <tr>
  140.           <?php
  141.             echo html_tag('td',_("Your SpamCop authorization code:""<br />" .
  142.             '<small>(' _("see below"')</small>','right','','valign="top"');
  143.           ?>
  144.           <td valign="top"><form method="post" action="options.php">
  145.             <input type="text" size="30" name="ID" value="<?php echo sm_encode_html_special_chars($spamcop_id?>" />
  146.             <input type="hidden" name="action" value="save_id" />
  147.             <?php
  148.               echo '<input type="submit" value="' _("Save ID""\" />\n";
  149.             ?>
  150.           </form></td>
  151.         </tr>
  152.       </table>
  153. <?php
  154. echo '<p><b>' _("About SpamCop"'</b><br />';
  155. echo _("SpamCop is a free service that greatly assists in finding the true source of the spam and helps in letting the proper people know about the abuse.");
  156. echo "</p>\n";
  157.  
  158. echo '<p>';
  159. printf(_("To use it, you must get a SpamCop authorization code. There is a free %ssign up page%s so you can use SpamCop.")'<a href="http://spamcop.net/anonsignup.shtml">''</a>');
  160. echo "</p>\n";
  161.  
  162. echo '<p><b>' _("Before you sign up, be warned"'</b><br />';
  163. printf(_("Some users have reported that the email addresses used with SpamCop find their way onto spam lists. To be safe, you can just create an email forwarding account and have all SpamCop reports get sent to there. Also, if it gets flooded with spam, you can then just delete that account with no worries about losing your real email address. Just go create an email forwarder somewhere (%s has a %slist of places%s) so that messages from system administrators and what not can be sent to you.")'<a href="http://www.yahoo.com/">Yahoo!</a>''<a href="http://dir.yahoo.com/Business_and_Economy/Business_to_Business/Communications_and_Networking/Internet_and_World_Wide_Web/Email_Providers/Forwarding_Services/Free_Forwarding/">''</a>');
  164. echo "</p>\n";
  165.  
  166. echo '<p>';
  167. echo _("Once you have signed up with SpamCop and have received your SpamCop authorization code, you need to enable this plugin by clicking the link above. Once enabled, you go about your normal life. If you encounter a spam message in your mailbox, just view it. On the right-hand side, near the top of where the message is displayed, you will see a link to report this message as spam. Clicking on it brings you to a confirmation page. Confirming that you want the spam report sent will do different things with different reporting methods.");
  168. echo "</p>\n";
  169.  
  170. echo '<p><b>' _("Email-based reporting"'</b><br />';
  171. 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.");
  172. echo "</p>\n";
  173.  
  174. if ($spamcop_quick_report{
  175.     echo '<p>';
  176.     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.");
  177.     echo "</p>\n";
  178. }
  179.  
  180. echo '<p><b>' _("Web-based reporting"'</b><br />';
  181. 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.");
  182. echo "</p>\n";
  183.  
  184. echo '<p>';
  185. echo _("The SpamCop service will display information as it finds it, so scroll down until you see a form button. It might pause a little while it is looking up information, so be a little patient. Read what it says, and submit the spam. Close the browser window. Press Cancel or click on the appropriate mail folder to see messages and/or delete the spam.");
  186. echo "</p>\n";
  187.  
  188. echo '<p><b>' _("SpamCop service type"'</b><br />';
  189. echo _("Service type option allows selecting which SpamCop services you are using. Member services use different web reporting forms and does not display nags. You can purchase these services, if you want to support SpamCop.");
  190. echo "</p>\n";
  191.  
  192. echo '<p><b>' _("More information"'</b><br />';
  193. printf(_("For more information about SpamCop, it's services, spam in general, and many related topics, try reading through SpamCop's %sHelp and Feedback%s section.")'<a href="http://spamcop.net/help.shtml">''</a>');
  194. echo "</p>\n";
  195. ?>
  196. </body></html>

Documentation generated on Mon, 13 Jan 2020 04:23:12 +0100 by phpDocumentor 1.4.3