A start for a new change_password master plugin. This is not finished
[squirrelmail.git] / plugins / filters / options.php
index 09c0a1325f9f1efe48a4ac02ef71386abe7cfaf1..3d2f60ae6e72b170bc015429ba33369d393a8a0a 100644 (file)
  * Also view plugins/README.plugins for more information.
  *
  * $Id$
+ * @package plugins
+ * @subpackage filters
  */
 
-/* Path for SquirrelMail required files. */
+/** Path for SquirrelMail required files. */
 define('SM_PATH','../../');
 
 /* SquirrelMail required files. */
@@ -36,23 +38,20 @@ require_once(SM_PATH . 'functions/imap_mailbox.php');
 require_once(SM_PATH . 'include/load_prefs.php');
 require_once(SM_PATH . 'plugins/filters/filters.php');
 
-   global $AllowSpamFilters;
+global $AllowSpamFilters;
 
-   displayPageHeader($color, 'None');
+displayPageHeader($color, 'None');
 
-   $username = $_SESSION['username'];
-   $key = $_COOKIE['key'];
-   $onetimepad = $_SESSION['onetimepad'];
-   $delimiter = $_SESSION['delimiter'];
-   if(isset($_GET['theid'])) {
-       $theid = $_GET['theid'];
-   }
-   if(isset($_POST['theid'])) {
-       $theid = $_POST['theid'];
-   }
-   if(isset($_GET['action'])) {
-       $action = $_GET['action'];
-   }
+/* get globals */
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+
+sqgetGlobalVar('theid', $theid);
+sqgetGlobalVar('action', $action, SQ_GET);
+
+// FIXME: use sqgetGlobalVar below.
 
    if (isset($_POST['filter_submit'])) {
       if(isset($_GET['theid'])) {
@@ -130,8 +129,6 @@ require_once(SM_PATH . 'plugins/filters/filters.php');
         'center' ) . '<br>';
 
     if (isset($action) && ($action == 'add' || $action == 'edit')) {
-        $username = $_SESSION['username'];
-        $key = $_COOKIE['key'];
 
         $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
         $boxes = sqimap_mailbox_list($imapConnection);
@@ -239,7 +236,8 @@ require_once(SM_PATH . 'plugins/filters/filters.php');
     echo '</table>'.
         html_tag( 'table',
             html_tag( 'tr',
-                html_tag( 'td', '&nbsp', 'left' )
+                html_tag( 'td', '&nbsp;', 'left' )
             ) ,
         'center', '', 'width="80%" border="0" cellpadding="2" cellspacing="0"' );
-?>
+    echo '</body></html>';
+?>
\ No newline at end of file