A start for a new change_password master plugin. This is not finished
[squirrelmail.git] / plugins / filters / setup.php
index 320c947f18203d7705cccd6c65dc999e781096e2..4f30654073b0b86abc35ab5cd6d2214b1584e3b9 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Message and Spam Filter Plugin
  *
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * This plugin filters your inbox into different folders based upon given
  * Also view plugins/README.plugins for more information.
  *
  * $Id$
+ * @package plugins
+ * @subpackage filters
  */
 
+/** SquirrelMail required files. */
+require_once(SM_PATH . 'plugins/filters/filters.php');
+
 /*
  * Set this to true if you have problems -- check the README file
  * Note:  This doesn't work all of the time (No idea why)
@@ -80,7 +85,7 @@ global $SpamFilters_DNScache;
  * in the bulkquery directory for more information on using bulkquery.
  */
 global $SpamFilters_BulkQuery;
-$SpamFilters_BulkQuery = "";
+$SpamFilters_BulkQuery = '';
 
 /*
  * Do you want to use a shared file for the DNS cache or a session variable?
@@ -97,14 +102,21 @@ $SpamFilters_SharedCache = true;
 global $SpamFilters_CacheTTL;
 $SpamFilters_CacheTTL = 7200;
 
-require_once ('../plugins/filters/filters.php');
-
 function squirrelmail_plugin_init_filters() {
     global $squirrelmail_plugin_hooks;
-    global $mailbox, $imap_stream, $imapConnection;
+
+    if (isset($_GET['mailbox'])) {
+        $mailbox = $_GET['mailbox'];
+    }
+    elseif (isset($_POST['mailbox'])) {
+        $mailbox = $_POST['mailbox'];
+    }
+    else {
+        $mailbox = 'INBOX';
+    }
 
     $squirrelmail_plugin_hooks['left_main_before']['filters'] = 'start_filters';
-    if ($mailbox == 'INBOX') {
+    if (isset($mailbox) && $mailbox == 'INBOX') {
         $squirrelmail_plugin_hooks['right_main_after_header']['filters'] = 'start_filters';
     }
     $squirrelmail_plugin_hooks['optpage_register_block']['filters'] = 'filters_optpage_register_block';
@@ -140,4 +152,4 @@ function filters_optpage_register_block() {
         );
     }
 }
-?>
+?>
\ No newline at end of file