squirrelmail-webmail  1.4.22
About: SquirrelMail is a standards-based webmail package with strong MIME support, address books, and folder manipulation (written in PHP4).
  Fossies Dox: squirrelmail-webmail-1.4.22.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

options.php
Go to the documentation of this file.
1 <?php
2 
12 define('SM_PATH','../../');
13 require_once(SM_PATH . 'include/validate.php');
14 
15 function 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 
24 displayPageHeader($color, 'None');
25 
26 /* globals */
27 sqgetGlobalVar('action', $action);
28 sqgetGlobalVar('meth', $meth);
29 sqgetGlobalVar('ID' , $ID);
30 
31 sqgetGlobalVar('username', $username, SQ_SESSION);
32 /* end of globals */
33 
34 $action = (!isset($action) ? '' : $action);
35 
36 switch ($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)) {
56  $ID = trim($ID);
57  $ID = preg_replace('/@.*/','',$ID);
58  $ID = preg_replace('/.*\./','',$ID);
59  setPref($data_dir, $username, 'spamcop_id', $ID);
60  }
61  break;
62 }
63 
65 spamcop_load();
66 
67 ?>
68  <br />
69  <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
70  <tr><td bgcolor="<?php echo $color[0]; ?>">
71  <center><b>
72  <?php echo _("Options") . " - " . _("Spam reporting"); ?>
73  </b></center>
74  </td></tr></table>
75  <br />
76 
77  <table align="center">
78  <tr>
79  <?php
80  echo html_tag('td',_("SpamCop link is:"),'right');
81  echo html_tag('td', spamcop_enable_disable($spamcop_enabled,'disable','enable') );
82  ?>
83  </tr>
84  <tr>
85  <?php
86  echo html_tag('td',_("Delete spam when reported:") . "<br />\n" .
87  '<small>(' . _("Only works with email-based reporting") . ')</small>',
88  'right','','valign="top"');
89  echo html_tag('td', spamcop_enable_disable($spamcop_delete,'save','delete'),'','','valign="top"');
90  ?>
91  </tr>
92  <tr>
93  <?php
94  echo html_tag('td',_("Spam Reporting Method:"),'right','','valign="top"');
95  ?>
96  <td>
97  <form method="post" action="options.php">
98  <select name="meth">
99  <?php
100  if ($spamcop_quick_report) {
101  echo '<option value="quick_email"';
102  if ($spamcop_method == 'quick_email') echo ' selected';
103  echo ">"._("Quick email-based reporting");
104  echo '</option>';
105  }
106 
107  $selected = '';
108  if ($spamcop_method == 'thorough_email') {
109  $selected = ' selected';
110  }
111  echo sprintf(' <option value="thorough_email"%s>%s</option>',$selected, _("Through email-based reporting"));
112 
113  $selected = '';
114  if ($spamcop_method == 'web_form') {
115  $selected = ' selected';
116  }
117  echo sprintf(' <option value="web_form"%s>%s</option>', $selected, _("Web-based form"));
118 
119  ?>
120  </select>
121  <input type="hidden" name="action" value="meth" />
122  <?php
123  echo '<input type="submit" value="' . _("Save Method") . "\" />\n";
124  ?>
125  </form></td>
126  </tr>
127  <tr>
128  <?php
129  echo html_tag('td',_("Your SpamCop authorization code:") . "<br />" .
130  '<small>(' . _("see below") . ')</small>','right','','valign="top"');
131  ?>
132  <td valign="top"><form method="post" action="options.php">
133  <input type="text" size="30" name="ID" value="<?php echo htmlspecialchars($spamcop_id) ?>" />
134  <input type="hidden" name="action" value="save_id" />
135  <?php
136  echo '<input type="submit" value="' . _("Save ID") . "\" />\n";
137  ?>
138  </form></td>
139  </tr>
140  </table>
141 <?php
142 echo '<p><b>' . _("About SpamCop") . '</b><br />';
143 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.");
144 echo "</p>\n";
145 
146 echo '<p>';
147 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>');
148 echo "</p>\n";
149 
150 echo '<p><b>' . _("Before you sign up, be warned") . '</b><br />';
151 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>');
152 echo "</p>\n";
153 
154 echo '<p>';
155 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.");
156 echo "</p>\n";
157 
158 echo '<p><b>' . _("Email-based reporting") . '</b><br />';
159 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.");
160 echo "</p>\n";
161 
163  echo '<p>';
164  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.");
165  echo "</p>\n";
166 }
167 
168 echo '<p><b>' . _("Web-based reporting") . '</b><br />';
169 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.");
170 echo "</p>\n";
171 
172 echo '<p>';
173 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.");
174 echo "</p>\n";
175 
176 echo '<p><b>' . _("SpamCop service type") . '</b><br />';
177 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.");
178 echo "</p>\n";
179 
180 echo '<p><b>' . _("More information") . '</b><br />';
181 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>');
182 echo "</p>\n";
183 ?>
184 </body></html>
sqgetGlobalVar
sqgetGlobalVar($name, &$value, $search=SQ_INORDER)
Definition: global.php:344
$ret
$ret
Definition: webmail.php:172
html_tag
html_tag( $tag, $val='', $align='', $bgcolor='', $xtra='')
Definition: html.php:27
SM_PATH
const SM_PATH
Definition: options.php:222
SQ_SESSION
const SQ_SESSION
Definition: global.php:18
displayPageHeader
displayPageHeader($color, $mailbox, $xtra='', $session=false)
Definition: page_header.php:105
setPref
setPref($data_dir, $username, $string, $set_to)
Definition: db_prefs.php:352
sprintf
powered by Systran sprintf(_("Number of supported language pairs: %s"), '36').' '
Definition: options.php:107
html
Definition: html.class.php:18
$spamcop_enabled
switch($action) global $spamcop_enabled
Definition: options.php:36
$spamcop_quick_report
switch($action) global $spamcop_quick_report
Definition: options.php:36
spamcop_enable_disable
spamcop_enable_disable($option, $disable_action, $enable_action)
Definition: options.php:15
spamcop_load
spamcop_load()
Definition: setup.php:32
$action
$action
Definition: options.php:34
_
_($str)
Definition: gettext.php:160
$spamcop_delete
switch($action) global $spamcop_delete
Definition: options.php:36
$color
global $color
Definition: options.php:19
$username
global $username
Definition: options.php:225
$data_dir
global $data_dir
Definition: options.php:225
$selected
if($spamcop_quick_report) $selected
Definition: options.php:107