4 ** options.php -- SpamCop options page
6 ** Copyright (c) 1999-2004 The SquirrelMail development team
7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
15 define('SM_PATH','../../');
16 require_once(SM_PATH
. 'include/validate.php');
19 * Internal spamcop plugin function.
21 * It is used to display similar action links.
23 function spamcop_enable_disable($option,$disable_action,$enable_action) {
25 $ret= _("Enabled") . "(<a href=\"options.php?action=$disable_action\">" . _("Disable it") . "</a>)\n";
27 $ret = _("Disabled") . "(<a href=\"options.php?action=$enable_action\">" . _("Enable it") . "</a>)\n";
32 displayPageHeader($color, 'None');
35 sqgetGlobalVar('action', $action);
36 sqgetGlobalVar('meth', $meth);
37 sqgetGlobalVar('type', $type);
38 sqgetGlobalVar('ID' , $ID);
40 sqgetGlobalVar('username', $username, SQ_SESSION
);
43 $action = (!isset($action) ?
'' : $action);
47 setPref($data_dir, $username, 'spamcop_enabled', 1);
50 setPref($data_dir, $username, 'spamcop_enabled', '');
53 setPref($data_dir, $username, 'spamcop_delete', '');
56 setPref($data_dir, $username, 'spamcop_delete', 1);
60 setPref($data_dir, $username, 'spamcop_method', $meth);
65 setPref($data_dir, $username, 'spamcop_type', $type);
71 $ID = preg_replace('/@.*/','',$ID);
72 $ID = preg_replace('/.*\./','',$ID);
73 setPref($data_dir, $username, 'spamcop_id', $ID);
78 global $spamcop_enabled, $spamcop_delete, $spamcop_quick_report;
83 <table width
="95%" align
="center" border
="0" cellpadding
="2" cellspacing
="0">
84 <tr
><td bgcolor
="<?php echo $color[0]; ?>">
86 <?php
echo _("Options") . " - " . _("Spam reporting"); ?
>
91 <table align
="center">
94 echo html_tag('td',_("SpamCop link is:"),'right');
95 echo html_tag('td', spamcop_enable_disable($spamcop_enabled,'disable','enable') );
100 echo html_tag('td',_("Delete spam when reported:") . "<br />\n" .
101 '<small>(' . _("Only works with email-based reporting") . ')</small>',
102 'right','','valign="top"');
103 echo html_tag('td', spamcop_enable_disable($spamcop_delete,'save','delete'),'','','valign="top"');
108 echo html_tag('td',_("Spam Reporting Method:"),'right');
110 <form method
="post" action
="options.php">
114 if ($spamcop_quick_report) {
115 echo '<option value="quick_email"';
116 if ($spamcop_method == 'quick_email') echo ' selected';
117 echo ">"._("Quick email-based reporting");
121 <option value
="thorough_email"
123 if ($spamcop_method == 'thorough_email') echo ' selected';
124 echo ">"._("Thorough email-based reporting");
127 <option value
="web_form"
129 if ($spamcop_method == 'web_form') echo ' selected';
130 echo ">"._("Web-based form");
134 <input type
="hidden" name
="action" value
="meth" />
136 echo '<input type="submit" value="' . _("Save Method") . "\" />\n";
142 echo html_tag('td',_("Spam Service Type:"),'right');
144 <form method
="post" action
="options.php">
149 if ($spamcop_type == 'free') echo ' selected';
150 echo ">"._("Free reporting");
153 <option value
="member"
155 if ($spamcop_type == 'member') echo ' selected';
156 echo ">"._("Member services");
161 echo '<input type="hidden" name="action" value="type" />' .
162 '<input type="submit" value="' . _("Save Service Type") . "\" />\n";
168 echo html_tag('td',_("Your SpamCop authorization code:") . "<br />" .
169 '<small>(' . _("see below") . ')</small>','right','','valign="top"');
171 <form method
="post" action
="options.php"><td valign
="top">
172 <input type
="text" size
="30" name
="ID" value
="<?php echo htmlspecialchars($spamcop_id) ?>" />
173 <input type
="hidden" name
="action" value
="save_id" />
175 echo '<input type="submit" value="' . _("Save ID") . "\" />\n";
182 echo _("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.");
186 echo _("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.");
190 echo _("<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.");
194 echo _("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.");
197 echo "<p><b>" . _("Email-based Reporting") . "</b><br />";
198 echo _("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.");
201 if ($spamcop_quick_report) {
203 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.");
207 echo "<p><b>" . _("Web-based Reporting") . "</b><br />";
208 echo _("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.");
212 echo _("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.");
215 echo "<p><b>". _("Spamcop Service Type") . "</b><br />\n";
216 echo _("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.");
220 echo _("<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.");