Adding template for error box.
[squirrelmail.git] / plugins / spamcop / options.php
CommitLineData
772be735 1<?php
772be735 2
f3a91d6b 3/**
4b4abf93 4 * options.php -- SpamCop options page
f3a91d6b 5 *
47ccfad4 6 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
f3a91d6b 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
8 * @version $Id$
9 * @package plugins
10 * @subpackage spamcop
11 */
04f6008a 12
ea5f4b8e 13/** @ignore */
92219031 14define('SM_PATH','../../');
da297dd0 15/* SquirrelMail functions */
8d6a115b 16require_once(SM_PATH . 'include/validate.php');
da297dd0 17/* plugin functions */
18include_once(SM_PATH . 'plugins/spamcop/functions.php');
876efbe1 19
04f6008a 20displayPageHeader($color, 'None');
91e0dccc 21
da297dd0 22/** is spamcop plugin disabled */
23// option changes do nothing, if read_body_header_right hook is not active.
24
04f6008a 25/* globals */
3267e4d8 26sqgetGlobalVar('action', $action);
27sqgetGlobalVar('meth', $meth);
9a422982 28sqgetGlobalVar('type', $type);
8ddc4111 29sqgetGlobalVar('ID' , $ID);
30
31sqgetGlobalVar('username', $username, SQ_SESSION);
04f6008a 32/* end of globals */
772be735 33
8d6a115b 34$action = (!isset($action) ? '' : $action);
772be735 35
8d6a115b 36switch ($action) {
37 case 'enable':
38 setPref($data_dir, $username, 'spamcop_enabled', 1);
39 break;
40 case 'disable':
41 setPref($data_dir, $username, 'spamcop_enabled', '');
42 break;
43 case 'save':
44 setPref($data_dir, $username, 'spamcop_delete', '');
45 break;
46 case 'delete':
47 setPref($data_dir, $username, 'spamcop_delete', 1);
48 break;
9f06a087 49 case 'keep':
50 setPref($data_dir, $username, 'spamcop_save', 0);
51 break;
52 case 'dontkeep':
53 setPref($data_dir, $username, 'spamcop_save', 1);
54 break;
8d6a115b 55 case 'meth':
56 if (isset($meth)) {
57 setPref($data_dir, $username, 'spamcop_method', $meth);
58 }
59 break;
9a422982 60 case 'type':
61 if (isset($type)) {
62 setPref($data_dir, $username, 'spamcop_type', $type);
63 }
91e0dccc 64 break;
8d6a115b 65 case 'save_id':
66 if (isset($ID)) {
dcf59aa6 67 $ID = trim($ID);
68 $ID = preg_replace('/@.*/','',$ID);
69 $ID = preg_replace('/.*\./','',$ID);
8d6a115b 70 setPref($data_dir, $username, 'spamcop_id', $ID);
71 }
72 break;
73}
74
9f06a087 75global $spamcop_enabled, $spamcop_delete, $spamcop_save, $spamcop_quick_report;
da297dd0 76spamcop_load_function();
8d6a115b 77
78?>
8ddc4111 79 <br />
80 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
81 <tr><td bgcolor="<?php echo $color[0]; ?>">
f265009a 82 <div style="text-align: center;"><b>
91e0dccc 83 <?php echo _("Options") . " - " . _("Spam reporting"); ?>
f265009a 84 </b></div>
772be735 85 </td></tr></table>
8ddc4111 86 <br />
91e0dccc 87
8ddc4111 88 <table align="center">
772be735 89 <tr>
91e0dccc 90 <?php
91 echo html_tag('td',_("SpamCop link is:"),'right');
92 echo html_tag('td', spamcop_enable_disable($spamcop_enabled,'disable','enable') );
93 ?>
94 </tr>
95 <tr>
96 <?php
97 echo html_tag('td',_("Delete spam when reported:") . "<br />\n" .
98 '<small>(' . _("Only works with email-based reporting") . ')</small>',
99 'right','','valign="top"');
100 echo html_tag('td', spamcop_enable_disable($spamcop_delete,'save','delete'),'','','valign="top"');
101 ?>
102 </tr>
103 <tr>
104 <?php
25051817 105 echo html_tag('td',_("Save emails submitted to SpamCop:") . "<br />\n" .
9f06a087 106 '<small>(' . _("Only works with email-based reporting") . ')</small>',
107 'right','','valign="top"');
108 echo html_tag('td', spamcop_enable_disable($spamcop_save,'keep','dontkeep'),'','','valign="top"');
109 ?>
110 </tr>
111 <tr>
112 <?php
91e0dccc 113 echo html_tag('td',_("Spam Reporting Method:"),'right');
114 ?>
115 <td>
116 <form method="post" action="options.php">
117 <select name="meth">
118 <?php
119 if ($spamcop_quick_report) {
120 echo '<option value="quick_email"';
121 if ($spamcop_method == 'quick_email') echo ' selected="selected"';
122 echo ">"._("Quick email-based reporting");
123 echo '</option>';
124 }
125 ?>
126 <option value="thorough_email"
127 <?php
128 if ($spamcop_method == 'thorough_email') echo ' selected="selected"';
129 echo ">"._("Thorough email-based reporting");
130 ?>
131 </option>
132 <option value="web_form"
133 <?php
134 if ($spamcop_method == 'web_form') echo ' selected="selected"';
135 echo ">"._("Web-based form");
136 ?>
137 </option>
138 </select>
139 <input type="hidden" name="action" value="meth" />
140 <?php
141 echo '<input type="submit" value="' . _("Save Method") . "\" />\n";
142 ?>
143 </form></td>
144 </tr>
145 <tr>
146 <?php
147 echo html_tag('td',_("Spam Service Type:"),'right');
148 ?>
149 <td>
150 <form method="post" action="options.php">
151 <select name="type">
152 <option value="free"
153 <?php
154 if ($spamcop_type == 'free') echo ' selected="selected"';
155 echo ">"._("Free reporting");
156 ?>
157 </option>
158 <option value="member"
159 <?php
160 if ($spamcop_type == 'member') echo ' selected="selected"';
161 echo ">"._("Member services");
162 ?>
163 </option>
164 </select>
165 <?php
166 echo '<input type="hidden" name="action" value="type" />' .
167 '<input type="submit" value="' . _("Save Service Type") . "\" />\n";
168 ?>
169 </form></td>
170 </tr>
772be735 171 <tr>
91e0dccc 172 <?php
173 echo html_tag('td',_("Your SpamCop authorization code:") . "<br />" .
174 '<small>(' . _("see below") . ')</small>','right','','valign="top"');
175 ?>
176 <td valign="top"><form method="post" action="options.php">
177 <input type="text" size="30" name="ID" value="<?php echo htmlspecialchars($spamcop_id) ?>" />
178 <input type="hidden" name="action" value="save_id" />
179 <?php
180 echo '<input type="submit" value="' . _("Save ID") . "\" />\n";
181 ?>
182 </form></td>
183 </tr>
772be735 184 </table>
2bd52bbe 185<?php
74091b64 186echo '<p><b>' . _("About SpamCop") . '</b><br />';
2bd52bbe 187echo _("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.");
188echo "</p>\n";
189
74091b64 190echo '<p>';
191printf(_("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>');
2bd52bbe 192echo "</p>\n";
193
74091b64 194echo '<p><b>' . _("Before you sign up, be warned") . '</b><br />';
195printf(_("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>');
2bd52bbe 196echo "</p>\n";
197
74091b64 198echo '<p>';
199echo _("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.");
2bd52bbe 200echo "</p>\n";
772be735 201
74091b64 202echo '<p><b>' . _("Email-based reporting") . '</b><br />';
ae394964 203echo _("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.");
74091b64 204echo "</p>\n";
772be735 205
057e9d6e 206if ($spamcop_quick_report) {
74091b64 207 echo '<p>';
208 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.");
209 echo "</p>\n";
057e9d6e 210}
2bd52bbe 211
74091b64 212echo '<p><b>' . _("Web-based reporting") . '</b><br />';
2bd52bbe 213echo _("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.");
214echo "</p>\n";
215
74091b64 216echo '<p>';
ae394964 217echo _("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.");
9a422982 218echo "</p>\n";
219
43404bdc 220echo '<p><b>' . _("SpamCop service type") . '</b><br />';
f71e1cae 221echo _("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 222echo "</p>\n";
223
74091b64 224echo '<p><b>' . _("More information") . '</b><br />';
225printf(_("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>');
2bd52bbe 226echo "</p>\n";
dcc1cc82 227?>
91e0dccc 228</body></html>