rtl alignment fix
[squirrelmail.git] / plugins / spamcop / options.php
CommitLineData
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$
ea5f4b8e 10 * @package plugins
11 * @subpackage spamcop
04f6008a 12 **/
13
ea5f4b8e 14/** @ignore */
92219031 15define('SM_PATH','../../');
8d6a115b 16require_once(SM_PATH . 'include/validate.php');
772be735 17
876efbe1 18function spamcop_enable_disable($option,$disable_action,$enable_action) {
19 if ($option) {
20 $ret= _("Enabled") . "(<a href=\"options.php?action=$disable_action\">" . _("Disable it") . "</a>)\n";
21 } else {
22 $ret = _("Disabled") . "(<a href=\"options.php?action=$enable_action\">" . _("Enable it") . "</a>)\n";
23 }
24 return $ret;
25}
26
04f6008a 27displayPageHeader($color, 'None');
28
29/* globals */
3267e4d8 30sqgetGlobalVar('action', $action);
31sqgetGlobalVar('meth', $meth);
8ddc4111 32sqgetGlobalVar('ID' , $ID);
33
34sqgetGlobalVar('username', $username, SQ_SESSION);
04f6008a 35/* end of globals */
772be735 36
8d6a115b 37$action = (!isset($action) ? '' : $action);
772be735 38
8d6a115b 39switch ($action) {
40 case 'enable':
41 setPref($data_dir, $username, 'spamcop_enabled', 1);
42 break;
43 case 'disable':
44 setPref($data_dir, $username, 'spamcop_enabled', '');
45 break;
46 case 'save':
47 setPref($data_dir, $username, 'spamcop_delete', '');
48 break;
49 case 'delete':
50 setPref($data_dir, $username, 'spamcop_delete', 1);
51 break;
52 case 'meth':
53 if (isset($meth)) {
54 setPref($data_dir, $username, 'spamcop_method', $meth);
55 }
56 break;
57 case 'save_id':
58 if (isset($ID)) {
dcf59aa6 59 $ID = trim($ID);
60 $ID = preg_replace('/@.*/','',$ID);
61 $ID = preg_replace('/.*\./','',$ID);
8d6a115b 62 setPref($data_dir, $username, 'spamcop_id', $ID);
63 }
64 break;
65}
66
057e9d6e 67global $spamcop_enabled, $spamcop_delete, $spamcop_quick_report;
8d6a115b 68spamcop_load();
69
70?>
8ddc4111 71 <br />
72 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
73 <tr><td bgcolor="<?php echo $color[0]; ?>">
876efbe1 74 <center><b><?php echo _("Options") . " - " . _("Spam reporting"); ?></b></center>
772be735 75 </td></tr></table>
8ddc4111 76 <br />
772be735 77
8ddc4111 78 <table align="center">
772be735 79 <tr>
876efbe1 80 <?php
81 echo html_tag('td',_("SpamCop link is:"),'right');
82 echo html_tag('td', spamcop_enable_disable($spamcop_enabled,'disable','enable') );
83 ?>
772be735 84 </tr>
85 <tr>
876efbe1 86 <?php
87 echo html_tag('td',_("Delete spam when reported:") . "<br />\n" .
88 '<font size="-2">(' . _("Only works with email-based reporting") . ')</font>',
89 'right','','valign="top"');
90 echo html_tag('td', spamcop_enable_disable($spamcop_delete,'save','delete'),'','','valign="top"');
91 ?>
772be735 92 </tr>
93 <tr>
876efbe1 94 <?php
95 echo html_tag('td',_("Spam Reporting Method:"),'right');
96 ?>
97 <form method="post" action="options.php">
98 <td>
8ddc4111 99 <select name="meth">
876efbe1 100 <?php
057e9d6e 101 if ($spamcop_quick_report) {
102 echo '<option value="quick_email"';
103 if ($spamcop_method == 'quick_email') echo ' selected';
104 echo ">"._("Quick email-based reporting");
105 echo '</option>';
106 }
107 ?>
876efbe1 108 <option value="thorough_email"
109 <?php
110 if ($spamcop_method == 'thorough_email') echo ' selected';
111 echo ">"._("Thorough email-based reporting");
112 ?>
113 </option>
114 <option value="web_form"
115 <?php
116 if ($spamcop_method == 'web_form') echo ' selected';
117 echo ">"._("Web-based form");
118 ?>
119 </option>
772be735 120 </select>
8ddc4111 121 <input type="hidden" name="action" value="meth">
876efbe1 122 <input type="submit" value="<?php echo _("Save Method"); ?>">
772be735 123 </td></form>
124 </tr>
125 <tr>
876efbe1 126 <?php
127 echo html_tag('td',_("Your SpamCop authorization code:") . "<br />" .
128 '<font size="-2">(' . _("see below") . ')</font>','right','','valign="top"');
129 ?>
8ddc4111 130 <form method="post" action="options.php"><td valign="top">
2bd52bbe 131 <input type="text" size="30" name="ID" value="<?php echo htmlspecialchars($spamcop_id) ?>" />
8ddc4111 132 <input type="hidden" name="action" value="save_id" />
876efbe1 133 <input type="submit" value="<?php echo _("Save ID"); ?>" />
772be735 134 </td></form>
135 </tr>
136 </table>
2bd52bbe 137<?php
138echo "<p>";
139echo _("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.");
140echo "</p>\n";
141
142echo "<p>";
143echo _("To use it, you must get a SpamCop authorization code. There is a free <a href=\"http://spamcop.net/anonsignup.shtml\">sign up page</a> so you can use SpamCop.");
144echo "</p>\n";
145
146echo "<p>";
147echo _("<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=\"http://www.yahoo.com/\">Yahoo!</a> has 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/\">list of places</a>) so that messages from system administrators and whatnot can be sent to you.");
148echo "</p>\n";
149
150echo "<p>";
151echo _("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.");
152echo "</p>\n";
772be735 153
2bd52bbe 154echo "<p><b>" . _("Email-based Reporting") . "</b><br />";
155echo _("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.");
156echo "</p>";
772be735 157
057e9d6e 158if ($spamcop_quick_report) {
2bd52bbe 159echo "<p>";
160echo _("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.");
161echo "</p>\n";
057e9d6e 162}
2bd52bbe 163
164echo "<p><b>" . _("Web-based Reporting") . "</b><br />";
165echo _("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.");
166echo "</p>\n";
167
168echo "<p>";
169echo _("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.");
170echo "</p>\n";
171
172echo "<p>";
dca6f270 173echo _("<b>For more information</b> about SpamCop, it's services, spam in general, and many related topics, try reading through SpamCop's <a href=\"http://spamcop.net/help.shtml\">Help and Feedback</a> section.");
2bd52bbe 174echo "</p>\n";
dcc1cc82 175?>
176</body></html>