Fix for security token missing in newmail plugin (#2919418).
[squirrelmail.git] / plugins / filters / spamoptions.php
index b4977941ce7b39f1e7d12af42109b634140dd574..7bd7842fa188905e939317ff81076ebda5028a50 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * Message and Spam Filter Plugin - Spam Options
  *
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2009 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
  */
 
 /**
- * Path for SquirrelMail required files.
- * @ignore
+ * Include the SquirrelMail initialization file.
  */
-define('SM_PATH','../../');
+require('../../include/init.php');
 
-/* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-include_once(SM_PATH . 'functions/imap.php');
+include_once(SM_PATH . 'functions/imap_general.php');
+include_once(SM_PATH . 'functions/imap_messages.php');
 include_once(SM_PATH . 'plugins/filters/filters.php');
 
 /* get globals */
-sqgetGlobalVar('username', $username, SQ_SESSION);
-sqgetGlobalVar('key', $key, SQ_COOKIE);
-sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
 
 sqgetGlobalVar('action', $action, SQ_GET);
 /* end globals */
 
-displayPageHeader($color, 'None');
+displayPageHeader($color);
 
 if (sqgetGlobalVar('spam_submit',$spam_submit,SQ_POST)) {
     $spam_filters = load_spam_filters();
@@ -82,7 +77,7 @@ if ($SpamFilters_YourHop == ' ') {
 
 
 if (isset($action) && $action == 'spam') {
-    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
+    $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0);
     $boxes = sqimap_mailbox_list($imapConnection);
     sqimap_logout($imapConnection);
     $numboxes = count($boxes);
@@ -217,4 +212,4 @@ if (isset($action) && $action == 'spam') {
     echo '</table>';
 }
 ?>
-</body></html>
\ No newline at end of file
+</body></html>