Move Thread View link to the upper header together with other links. Behaviour can...
[squirrelmail.git] / plugins / spamcop / options.php
CommitLineData
772be735 1<?php
772be735 2
04f6008a 3 /**
4 ** options.php -- SpamCop options page
5 **
82d304a0 6 ** Copyright (c) 1999-2004 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
9a422982 18/**
19 * Internal spamcop plugin function.
20 *
21 * It is used to display similar action links.
22 */
876efbe1 23function spamcop_enable_disable($option,$disable_action,$enable_action) {
24 if ($option) {
25 $ret= _("Enabled") . "(<a href=\"options.php?action=$disable_action\">" . _("Disable it") . "</a>)\n";
26 } else {
27 $ret = _("Disabled") . "(<a href=\"options.php?action=$enable_action\">" . _("Enable it") . "</a>)\n";
28 }
29 return $ret;
30}
31
04f6008a 32displayPageHeader($color, 'None');
33
34/* globals */
3267e4d8 35sqgetGlobalVar('action', $action);
36sqgetGlobalVar('meth', $meth);
9a422982 37sqgetGlobalVar('type', $type);
8ddc4111 38sqgetGlobalVar('ID' , $ID);
39
40sqgetGlobalVar('username', $username, SQ_SESSION);
04f6008a 41/* end of globals */
772be735 42
8d6a115b 43$action = (!isset($action) ? '' : $action);
772be735 44
8d6a115b 45switch ($action) {
46 case 'enable':
47 setPref($data_dir, $username, 'spamcop_enabled', 1);
48 break;
49 case 'disable':
50 setPref($data_dir, $username, 'spamcop_enabled', '');
51 break;
52 case 'save':
53 setPref($data_dir, $username, 'spamcop_delete', '');
54 break;
55 case 'delete':
56 setPref($data_dir, $username, 'spamcop_delete', 1);
57 break;
58 case 'meth':
59 if (isset($meth)) {
60 setPref($data_dir, $username, 'spamcop_method', $meth);
61 }
62 break;
9a422982 63 case 'type':
64 if (isset($type)) {
65 setPref($data_dir, $username, 'spamcop_type', $type);
66 }
67 break;
8d6a115b 68 case 'save_id':
69 if (isset($ID)) {
dcf59aa6 70 $ID = trim($ID);
71 $ID = preg_replace('/@.*/','',$ID);
72 $ID = preg_replace('/.*\./','',$ID);
8d6a115b 73 setPref($data_dir, $username, 'spamcop_id', $ID);
74 }
75 break;
76}
77
057e9d6e 78global $spamcop_enabled, $spamcop_delete, $spamcop_quick_report;
8d6a115b 79spamcop_load();
80
81?>
8ddc4111 82 <br />
83 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
84 <tr><td bgcolor="<?php echo $color[0]; ?>">
876efbe1 85 <center><b><?php echo _("Options") . " - " . _("Spam reporting"); ?></b></center>
772be735 86 </td></tr></table>
8ddc4111 87 <br />
772be735 88
8ddc4111 89 <table align="center">
772be735 90 <tr>
876efbe1 91 <?php
92 echo html_tag('td',_("SpamCop link is:"),'right');
93 echo html_tag('td', spamcop_enable_disable($spamcop_enabled,'disable','enable') );
94 ?>
772be735 95 </tr>
96 <tr>
876efbe1 97 <?php
98 echo html_tag('td',_("Delete spam when reported:") . "<br />\n" .
99 '<font size="-2">(' . _("Only works with email-based reporting") . ')</font>',
100 'right','','valign="top"');
101 echo html_tag('td', spamcop_enable_disable($spamcop_delete,'save','delete'),'','','valign="top"');
102 ?>
772be735 103 </tr>
104 <tr>
876efbe1 105 <?php
106 echo html_tag('td',_("Spam Reporting Method:"),'right');
107 ?>
108 <form method="post" action="options.php">
109 <td>
8ddc4111 110 <select name="meth">
876efbe1 111 <?php
057e9d6e 112 if ($spamcop_quick_report) {
113 echo '<option value="quick_email"';
114 if ($spamcop_method == 'quick_email') echo ' selected';
115 echo ">"._("Quick email-based reporting");
116 echo '</option>';
117 }
118 ?>
876efbe1 119 <option value="thorough_email"
120 <?php
121 if ($spamcop_method == 'thorough_email') echo ' selected';
122 echo ">"._("Thorough email-based reporting");
123 ?>
124 </option>
125 <option value="web_form"
126 <?php
127 if ($spamcop_method == 'web_form') echo ' selected';
128 echo ">"._("Web-based form");
129 ?>
130 </option>
772be735 131 </select>
8ddc4111 132 <input type="hidden" name="action" value="meth">
876efbe1 133 <input type="submit" value="<?php echo _("Save Method"); ?>">
772be735 134 </td></form>
135 </tr>
136 <tr>
9a422982 137 <?php
138 echo html_tag('td',_("Spam Service Type:"),'right');
139 ?>
140 <form method="post" action="options.php">
141 <td>
142 <select name="type">
143 <option value="free"
144 <?php
145 if ($spamcop_type == 'free') echo ' selected';
146 echo ">"._("Free reporting");
147 ?>
148 </option>
149 <option value="member"
150 <?php
151 if ($spamcop_type == 'member') echo ' selected';
152 echo ">"._("Member services");
153 ?>
154 </option>
155 </select>
156 <input type="hidden" name="action" value="type">
157 <input type="submit" value="<?php echo _("Save Service Type"); ?>">
158 </td></form>
159 </tr>
160 <tr>
876efbe1 161 <?php
162 echo html_tag('td',_("Your SpamCop authorization code:") . "<br />" .
163 '<font size="-2">(' . _("see below") . ')</font>','right','','valign="top"');
164 ?>
8ddc4111 165 <form method="post" action="options.php"><td valign="top">
2bd52bbe 166 <input type="text" size="30" name="ID" value="<?php echo htmlspecialchars($spamcop_id) ?>" />
8ddc4111 167 <input type="hidden" name="action" value="save_id" />
876efbe1 168 <input type="submit" value="<?php echo _("Save ID"); ?>" />
772be735 169 </td></form>
170 </tr>
171 </table>
2bd52bbe 172<?php
173echo "<p>";
174echo _("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.");
175echo "</p>\n";
176
177echo "<p>";
178echo _("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.");
179echo "</p>\n";
180
181echo "<p>";
182echo _("<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.");
183echo "</p>\n";
184
185echo "<p>";
186echo _("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.");
187echo "</p>\n";
772be735 188
2bd52bbe 189echo "<p><b>" . _("Email-based Reporting") . "</b><br />";
190echo _("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.");
191echo "</p>";
772be735 192
057e9d6e 193if ($spamcop_quick_report) {
2bd52bbe 194echo "<p>";
195echo _("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.");
196echo "</p>\n";
057e9d6e 197}
2bd52bbe 198
199echo "<p><b>" . _("Web-based Reporting") . "</b><br />";
200echo _("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.");
201echo "</p>\n";
202
203echo "<p>";
9a422982 204echo _("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.");
205echo "</p>\n";
206
207echo "<p><b>". _("Spamcop Service Type") . "</b><br />\n";
208echo _("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.");
2bd52bbe 209echo "</p>\n";
210
211echo "<p>";
dca6f270 212echo _("<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 213echo "</p>\n";
dcc1cc82 214?>
215</body></html>