Using human readable names of time formats. option 1 and 2 still has to be
[squirrelmail.git] / plugins / spamcop / options.php
772be735 1<?php
772be735 2
04f6008a 3 /**
4 ** options.php -- SpamCop options page
5 **
76911253 6 ** Copyright (c) 1999-2003 The SquirrelMail development team
04f6008a 7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 **
9 ** $Id$
10 **/
92219031 12define('SM_PATH','../../');
8d6a115b 13require_once(SM_PATH . 'include/validate.php');
772be735 14
04f6008a 15displayPageHeader($color, 'None');
17/* globals */
3267e4d8 18sqgetGlobalVar('action', $action);
19sqgetGlobalVar('meth', $meth);
8ddc4111 20sqgetGlobalVar('ID' , $ID);
22sqgetGlobalVar('username', $username, SQ_SESSION);
04f6008a 23/* end of globals */
772be735 24
8d6a115b 25$action = (!isset($action) ? '' : $action);
772be735 26
8d6a115b 27switch ($action) {
28 case 'enable':
29 setPref($data_dir, $username, 'spamcop_enabled', 1);
30 break;
31 case 'disable':
32 setPref($data_dir, $username, 'spamcop_enabled', '');
33 break;
34 case 'save':
35 setPref($data_dir, $username, 'spamcop_delete', '');
36 break;
37 case 'delete':
38 setPref($data_dir, $username, 'spamcop_delete', 1);
39 break;
40 case 'meth':
41 if (isset($meth)) {
42 setPref($data_dir, $username, 'spamcop_method', $meth);
43 }
44 break;
45 case 'save_id':
46 if (isset($ID)) {
dcf59aa6 47 $ID = trim($ID);
48 $ID = preg_replace('/@.*/','',$ID);
49 $ID = preg_replace('/.*\./','',$ID);
8d6a115b 50 setPref($data_dir, $username, 'spamcop_id', $ID);
51 }
52 break;
55global $spamcop_enabled, $spamcop_delete;
8ddc4111 59 <br />
60 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
61 <tr><td bgcolor="<?php echo $color[0]; ?>">
62 <center><b><?php echo _("Options"); ?> - Message Filtering</b></center>
772be735 63 </td></tr></table>
8ddc4111 64 <br />
772be735 65
8ddc4111 66 <table align="center">
772be735 67 <tr>
8ddc4111 68 <td align="right">SpamCop link is:</td>
69 <td><?php if ($spamcop_enabled) {
772be735 70 ?>Enabled (<a href="options.php?action=disable">Disable it</a>)
71 <?PHP } else {
72 ?>Disabled (<a href="options.php?action=enable">Enable it</a>)
73 <?PHP }
74 ?></td>
75 </tr>
76 <tr>
8ddc4111 77 <td align="right" valign="top">Delete spam when reported:<br />
772be735 78 <font size="-2">(Only works with email-based reporting)</font>
79 </td>
8ddc4111 80 <td valign="top"><?php if ($spamcop_delete) {
772be735 81 ?>Enabled (<a href="options.php?action=save">Disable it</a>)
8ddc4111 82 <?php } else {
772be735 83 ?>Disabled (<a href="options.php?action=delete">Enable it</a>)
8ddc4111 84 <?php }
772be735 85 ?></td>
86 </tr>
87 <tr>
8ddc4111 88 <td align="right">Spam Reporting Method:</td>
89 <form method="post" action="options.php"><td>
90 <select name="meth">
91 <option value="quick_email"<?php
92 if ($spamcop_method == 'quick_email') echo ' selected'
772be735 93 ?>>Quick email-based reporting</option>
8ddc4111 94 <option value="thorough_email"<?php
95 if ($spamcop_method == 'thorough_email') echo ' selected'
772be735 96 ?>>Thorough email-based reporting</option>
8ddc4111 97 <option value="web_form"<?php
98 if ($spamcop_method == 'web_form') echo ' selected'
772be735 99 ?>>Web-based form</option>
100 </select>
8ddc4111 101 <input type="hidden" name="action" value="meth">
102 <input type="submit" value="Save Method">
772be735 103 </td></form>
104 </tr>
105 <tr>
8ddc4111 106 <td valign="top" align="right">Your SpamCop authorization code:<br />
772be735 107 <font size="-2">(see below)</font>
108 </td>
8ddc4111 109 <form method="post" action="options.php"><td valign="top">
2bd52bbe 110 <input type="text" size="30" name="ID" value="<?php echo htmlspecialchars($spamcop_id) ?>" />
8ddc4111 111 <input type="hidden" name="action" value="save_id" />
112 <input type="submit" value="Save ID" />
772be735 113 </td></form>
114 </tr>
115 </table>
2bd52bbe 116<?php
117echo "<p>";
118echo _("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.");
119echo "</p>\n";
121echo "<p>";
122echo _("To use it, you must get a SpamCop authorization code. There is a free <a href=\"\">sign up page</a> so you can use SpamCop.");
123echo "</p>\n";
125echo "<p>";
126echo _("<b>Before you sign up, be warned:</b> 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 (<a href=\"\">Yahoo!</a> has a <a href=\"\">list of places</a>) so that messages from system administrators and whatnot can be sent to you.");
127echo "</p>\n";
129echo "<p>";
130echo _("Once you have signed up with SpamCop and have received your SpamCop authorization code, you need to enable this plugin -- just click 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.");
131echo "</p>\n";
772be735 132
2bd52bbe 133echo "<p><b>" . _("Email-based Reporting") . "</b><br />";
134echo _("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.");
135echo "</p>";
772be735 136
2bd52bbe 137echo "<p>";
138echo _("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.");
139echo "</p>\n";
141echo "<p><b>" . _("Web-based Reporting") . "</b><br />";
142echo _("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.");
143echo "</p>\n";
145echo "<p>";
146echo _("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.");
147echo "</p>\n";
149echo "<p>";
dca6f270 150echo _("<b>For more information</b> about SpamCop, it's services, spam in general, and many related topics, try reading through SpamCop's <a href=\"\">Help and Feedback</a> section.");
2bd52bbe 151echo "</p>\n";
772be735 153</body></html>