Converting strings to gettext
[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
876efbe1 15function spamcop_enable_disable($option,$disable_action,$enable_action) {
16 if ($option) {
17 $ret= _("Enabled") . "(<a href=\"options.php?action=$disable_action\">" . _("Disable it") . "</a>)\n";
18 } else {
19 $ret = _("Disabled") . "(<a href=\"options.php?action=$enable_action\">" . _("Enable it") . "</a>)\n";
20 }
21 return $ret;
22}
23
04f6008a 24displayPageHeader($color, 'None');
25
26/* globals */
3267e4d8 27sqgetGlobalVar('action', $action);
28sqgetGlobalVar('meth', $meth);
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;
49 case 'meth':
50 if (isset($meth)) {
51 setPref($data_dir, $username, 'spamcop_method', $meth);
52 }
53 break;
54 case 'save_id':
55 if (isset($ID)) {
dcf59aa6 56 $ID = trim($ID);
57 $ID = preg_replace('/@.*/','',$ID);
58 $ID = preg_replace('/.*\./','',$ID);
8d6a115b 59 setPref($data_dir, $username, 'spamcop_id', $ID);
60 }
61 break;
62}
63
64global $spamcop_enabled, $spamcop_delete;
65spamcop_load();
66
67?>
8ddc4111 68 <br />
69 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
70 <tr><td bgcolor="<?php echo $color[0]; ?>">
876efbe1 71 <center><b><?php echo _("Options") . " - " . _("Spam reporting"); ?></b></center>
772be735 72 </td></tr></table>
8ddc4111 73 <br />
772be735 74
8ddc4111 75 <table align="center">
772be735 76 <tr>
876efbe1 77 <?php
78 echo html_tag('td',_("SpamCop link is:"),'right');
79 echo html_tag('td', spamcop_enable_disable($spamcop_enabled,'disable','enable') );
80 ?>
772be735 81 </tr>
82 <tr>
876efbe1 83 <?php
84 echo html_tag('td',_("Delete spam when reported:") . "<br />\n" .
85 '<font size="-2">(' . _("Only works with email-based reporting") . ')</font>',
86 'right','','valign="top"');
87 echo html_tag('td', spamcop_enable_disable($spamcop_delete,'save','delete'),'','','valign="top"');
88 ?>
772be735 89 </tr>
90 <tr>
876efbe1 91 <?php
92 echo html_tag('td',_("Spam Reporting Method:"),'right');
93 ?>
94 <form method="post" action="options.php">
95 <td>
8ddc4111 96 <select name="meth">
876efbe1 97 <option value="quick_email"
98 <?php
99 if ($spamcop_method == 'quick_email') echo ' selected';
100 echo ">"._("Quick email-based reporting");
101 ?>
102 </option>
103 <option value="thorough_email"
104 <?php
105 if ($spamcop_method == 'thorough_email') echo ' selected';
106 echo ">"._("Thorough email-based reporting");
107 ?>
108 </option>
109 <option value="web_form"
110 <?php
111 if ($spamcop_method == 'web_form') echo ' selected';
112 echo ">"._("Web-based form");
113 ?>
114 </option>
772be735 115 </select>
8ddc4111 116 <input type="hidden" name="action" value="meth">
876efbe1 117 <input type="submit" value="<?php echo _("Save Method"); ?>">
772be735 118 </td></form>
119 </tr>
120 <tr>
876efbe1 121 <?php
122 echo html_tag('td',_("Your SpamCop authorization code:") . "<br />" .
123 '<font size="-2">(' . _("see below") . ')</font>','right','','valign="top"');
124 ?>
8ddc4111 125 <form method="post" action="options.php"><td valign="top">
2bd52bbe 126 <input type="text" size="30" name="ID" value="<?php echo htmlspecialchars($spamcop_id) ?>" />
8ddc4111 127 <input type="hidden" name="action" value="save_id" />
876efbe1 128 <input type="submit" value="<?php echo _("Save ID"); ?>" />
772be735 129 </td></form>
130 </tr>
131 </table>
2bd52bbe 132<?php
133echo "<p>";
134echo _("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.");
135echo "</p>\n";
136
137echo "<p>";
138echo _("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.");
139echo "</p>\n";
140
141echo "<p>";
142echo _("<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.");
143echo "</p>\n";
144
145echo "<p>";
146echo _("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.");
147echo "</p>\n";
772be735 148
2bd52bbe 149echo "<p><b>" . _("Email-based Reporting") . "</b><br />";
150echo _("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.");
151echo "</p>";
772be735 152
2bd52bbe 153echo "<p>";
154echo _("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.");
155echo "</p>\n";
156
157echo "<p><b>" . _("Web-based Reporting") . "</b><br />";
158echo _("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.");
159echo "</p>\n";
160
161echo "<p>";
162echo _("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.");
163echo "</p>\n";
164
165echo "<p>";
dca6f270 166echo _("<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 167echo "</p>\n";
168?>
772be735 169</body></html>