4 * options.php -- SpamCop options page
6 * @copyright (c) 1999-2005 The SquirrelMail Project Team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
14 define('SM_PATH','../../');
15 /* SquirrelMail functions */
16 require_once(SM_PATH
. 'include/validate.php');
17 /* plugin functions */
18 include_once(SM_PATH
. 'plugins/spamcop/functions.php');
20 displayPageHeader($color, 'None');
22 /** is spamcop plugin disabled */
23 // option changes do nothing, if read_body_header_right hook is not active.
26 sqgetGlobalVar('action', $action);
27 sqgetGlobalVar('meth', $meth);
28 sqgetGlobalVar('type', $type);
29 sqgetGlobalVar('ID' , $ID);
31 sqgetGlobalVar('username', $username, SQ_SESSION
);
34 $action = (!isset($action) ?
'' : $action);
38 setPref($data_dir, $username, 'spamcop_enabled', 1);
41 setPref($data_dir, $username, 'spamcop_enabled', '');
44 setPref($data_dir, $username, 'spamcop_delete', '');
47 setPref($data_dir, $username, 'spamcop_delete', 1);
50 setPref($data_dir, $username, 'spamcop_save', 0);
53 setPref($data_dir, $username, 'spamcop_save', 1);
57 setPref($data_dir, $username, 'spamcop_method', $meth);
62 setPref($data_dir, $username, 'spamcop_type', $type);
68 $ID = preg_replace('/@.*/','',$ID);
69 $ID = preg_replace('/.*\./','',$ID);
70 setPref($data_dir, $username, 'spamcop_id', $ID);
75 global $spamcop_enabled, $spamcop_delete, $spamcop_save, $spamcop_quick_report;
76 spamcop_load_function();
80 <table width
="95%" align
="center" border
="0" cellpadding
="2" cellspacing
="0">
81 <tr
><td bgcolor
="<?php echo $color[0]; ?>">
83 <?php
echo _("Options") . " - " . _("Spam reporting"); ?
>
88 <table align
="center">
91 echo html_tag('td',_("SpamCop link is:"),'right');
92 echo html_tag('td', spamcop_enable_disable($spamcop_enabled,'disable','enable') );
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"');
105 echo html_tag('td',_("Save emails submitted to spamcop:") . "<br />\n" .
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"');
113 echo html_tag('td',_("Spam Reporting Method:"),'right');
116 <form method
="post" action
="options.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");
126 <option value
="thorough_email"
128 if ($spamcop_method == 'thorough_email') echo ' selected="selected"';
129 echo ">"._("Thorough email-based reporting");
132 <option value
="web_form"
134 if ($spamcop_method == 'web_form') echo ' selected="selected"';
135 echo ">"._("Web-based form");
139 <input type
="hidden" name
="action" value
="meth" />
141 echo '<input type="submit" value="' . _("Save Method") . "\" />\n";
147 echo html_tag('td',_("Spam Service Type:"),'right');
150 <form method
="post" action
="options.php">
154 if ($spamcop_type == 'free') echo ' selected="selected"';
155 echo ">"._("Free reporting");
158 <option value
="member"
160 if ($spamcop_type == 'member') echo ' selected="selected"';
161 echo ">"._("Member services");
166 echo '<input type="hidden" name="action" value="type" />' .
167 '<input type="submit" value="' . _("Save Service Type") . "\" />\n";
173 echo html_tag('td',_("Your SpamCop authorization code:") . "<br />" .
174 '<small>(' . _("see below") . ')</small>','right','','valign="top"');
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" />
180 echo '<input type="submit" value="' . _("Save ID") . "\" />\n";
186 echo '<p><b>' . _("About SpamCop") . '</b><br />';
187 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.");
191 printf(_("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>');
194 echo '<p><b>' . _("Before you sign up, be warned") . '</b><br />';
195 printf(_("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>');
199 echo _("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.");
202 echo '<p><b>' . _("Email-based reporting") . '</b><br />';
203 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.");
206 if ($spamcop_quick_report) {
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.");
212 echo '<p><b>' . _("Web-based reporting") . '</b><br />';
213 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.");
217 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.");
220 echo '<p><b>' . _("SpamCop service type") . '</b><br />';
221 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.");
224 echo '<p><b>' . _("More information") . '</b><br />';
225 printf(_("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>');