Remove the unnecesary sqextractGlobalVar function, and replace with the new
[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$
10 **/
11
92219031 12define('SM_PATH','../../');
8d6a115b 13require_once(SM_PATH . 'include/validate.php');
772be735 14
04f6008a 15displayPageHeader($color, 'None');
16
17/* globals */
18sqextractGlobalVar('action');
19sqextractGlobalVar('meth');
20sqextractGlobalVar('ID');
21extract($_SESSION);
22/* end of globals */
772be735 23
8d6a115b 24$action = (!isset($action) ? '' : $action);
772be735 25
8d6a115b 26switch ($action) {
27 case 'enable':
28 setPref($data_dir, $username, 'spamcop_enabled', 1);
29 break;
30 case 'disable':
31 setPref($data_dir, $username, 'spamcop_enabled', '');
32 break;
33 case 'save':
34 setPref($data_dir, $username, 'spamcop_delete', '');
35 break;
36 case 'delete':
37 setPref($data_dir, $username, 'spamcop_delete', 1);
38 break;
39 case 'meth':
40 if (isset($meth)) {
41 setPref($data_dir, $username, 'spamcop_method', $meth);
42 }
43 break;
44 case 'save_id':
45 if (isset($ID)) {
dcf59aa6 46 $ID = trim($ID);
47 $ID = preg_replace('/@.*/','',$ID);
48 $ID = preg_replace('/.*\./','',$ID);
8d6a115b 49 setPref($data_dir, $username, 'spamcop_id', $ID);
50 }
51 break;
52}
53
54global $spamcop_enabled, $spamcop_delete;
55spamcop_load();
56
57?>
772be735 58 <br>
59 <table width=95% align=center border=0 cellpadding=2 cellspacing=0><tr><td bgcolor="<?php echo $color[0] ?>">
60 <center><b><?php echo _("Options") ?> - Message Filtering</b></center>
61 </td></tr></table>
62 <br>
63
64 <table align=center>
65 <tr>
66 <td align=right>SpamCop link is:</td>
67 <td><?PHP if ($spamcop_enabled) {
68 ?>Enabled (<a href="options.php?action=disable">Disable it</a>)
69 <?PHP } else {
70 ?>Disabled (<a href="options.php?action=enable">Enable it</a>)
71 <?PHP }
72 ?></td>
73 </tr>
74 <tr>
75 <td align=right valign=top>Delete spam when reported:<br>
76 <font size="-2">(Only works with email-based reporting)</font>
77 </td>
78 <td valign=top><?PHP if ($spamcop_delete) {
79 ?>Enabled (<a href="options.php?action=save">Disable it</a>)
80 <?PHP } else {
81 ?>Disabled (<a href="options.php?action=delete">Enable it</a>)
82 <?PHP }
83 ?></td>
84 </tr>
85 <tr>
86 <td align=right>Spam Reporting Method:</td>
87 <form method=post action=options.php><td>
88 <select name=meth>
89 <option value="quick_email"<?PHP
90 if ($spamcop_method == 'quick_email') echo ' SELECTED'
91 ?>>Quick email-based reporting</option>
92 <option value="thorough_email"<?PHP
93 if ($spamcop_method == 'thorough_email') echo ' SELECTED'
94 ?>>Thorough email-based reporting</option>
95 <option value="web_form"<?PHP
96 if ($spamcop_method == 'web_form') echo ' SELECTED'
97 ?>>Web-based form</option>
98 </select>
99 <input type=hidden name=action value=meth>
100 <input type=submit value="Save Method">
101 </td></form>
102 </tr>
103 <tr>
104 <td valign=top align=right>Your SpamCop authorization code:<br>
105 <font size="-2">(see below)</font>
106 </td>
107 <form method=post action=options.php><td valign=top>
108 <input type=text size=30 name="ID" value="<?PHP
109 echo htmlspecialchars($spamcop_id) ?>">
110 <input type=hidden name=action value=save_id>
111 <input type=submit value="Save ID">
112 </td></form>
113 </tr>
114 </table>
115
116<p>SpamCop is a free service that greatly assists in finding the true source
117of the spam and helps in letting the proper people know about the abuse.</p>
118
119<p>To use it, you must get a SpamCop authorization code. There is a free <a
120href="http://spamcop.net/anonsignup.shtml">sign up page</a> so you can use
121SpamCop.</p>
122
123<p><b>Before you sign up, be warned:</b> Some users have reported that the
124email addresses used with SpamCop find their way onto spam lists. To be
125safe, you can just create an email forwarding account and have all SpamCop
126reports get sent to there. Also, if it gets flooded with spam, you can then
127just delete that account with no worries about losing your real email address.
128Just go create an email forwarder somewhere (<a
129href="http://www.yahoo.com/">Yahoo!</a> has a <a
130href="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
131of places</a>) so that messages from system administrators and whatnot can
132be sent to you.</p>
133
134<p>Once you have signed up with SpamCop and have received your SpamCop
135authorization code, you need to enable this plugin -- just click the link
136above. Once enabled, you go about your normal life. If you encounter a
137spam message in your mailbox, just view it. On the right-hand side, near
138the top of where the message is displayed, you will see a link to report
139this message as spam. Clicking on it brings you to a confirmation page.
140Confirming that you want the spam report sent will do different things with
141different reporting methods.</p>
142
143<p><b>Email-based Reporting</b><br>
144Pressing the button forwards the message to the SpamCop service and will
145optionally delete the message. From there, you just need to go to your
146INBOX and quite soon a message should appear from SpamCop. (It gets sent to
147the account you registered with, so make sure that your mail forwarder works!)
148Open it up, click on the appropriate link at the top, and a new browser
149window will open.</p>
150
151<p>Currently, the quick reporting just forwards the request to the thorough
152reporting. Also, it appears that this is for members (non-free) only.
153Hopefully this will change soon.</p>
154
155<p><b>Web-based Reporting</b><br>
156When you press the button on the confirmation page, this will pop open a new
157browser window and the SpamCop service should appear inside. The message
158will not be deleted (working on that part), but you won't need to wait for a
159response email to start the spam reporting.</p>
160
161<p>The SpamCop service will display information as it finds it, so scroll
162down until you see a form button. It might pause a little while it is
163looking up information, so be a little patient. Read what it says, and
164submit the spam. Close the browser window. Press Cancel or click on the
165appropriate mail folder to see messages and/or delete the spam.</p>
166
167<p><b>For more information</b> about SpamCop, it's services, spam in general,
168and many related topics, try reading through SpamCop's <a
169href="http://spamcop.net/help.shtml">Help and Feedback</a> section.</p>
170
171</body></html>