Back out support for using SM without Frames
[squirrelmail.git] / plugins / squirrelspell / sqspell_functions.php
index d73e0197394e5c1e91bd73da9bc5e7efbcb4a59a..43a0313346f890afc1fa0972d6c0002be78cd63b 100644 (file)
@@ -4,13 +4,15 @@
  * ----------------------
  * All SquirrelSpell-wide functions are in this file.
  *
- * Copyright (c) 1999-2002 The SquirrelMail development team
+ * Copyright (c) 1999-2003 The SquirrelMail development team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * $Id$
  *
  * @author Konstantin Riabitsev <icon@duke.edu> ($Author$)
  * @version $Date$
+ * @package plugins
+ * @subpackage squirrelspell
  */
 
 /**
  * @return            void
  */
 function sqspell_makePage($title, $scriptsrc, $body){
-  global $color, $SQSPELL_VERSION, $MOD;
+  global $color, $SQSPELL_VERSION;
+
+  if (! sqgetGlobalVar('MOD', $MOD, SQ_GET) ) {
+      $MOD = 'options_main';
+  }
+
   displayPageHeader($color, 'None');  
   echo "&nbsp;<br>\n";
   /**
@@ -68,7 +75,8 @@ function sqspell_makePage($title, $scriptsrc, $body){
           ) . "\n"
     . html_tag( 'tr',
           html_tag( 'td', 'SquirrelSpell ' . $SQSPELL_VERSION, 'center', $color[9] )
-      ) . "\n";
+      ) . "\n</table>\n";
+  echo '</body></html>';
 }
 
 /**
@@ -331,9 +339,13 @@ function sqspell_getWords(){
      * the user's old mailbox password. I admin, this is rather dirty,
      * but efficient. ;)
      */
-    global $key, $onetimepad, $old_key;
-    if ($old_key) {
-      $clear_key=$old_key;
+    sqgetGlobalVar('key', $key, SQ_COOKIE);
+    sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+
+    sqgetGlobalVar('old_key', $old_key, SQ_POST);
+
+    if ($old_key != '') {
+        $clear_key=$old_key;
     } else {
       /**
        * Get user's password (the key).
@@ -443,7 +455,9 @@ function sqspell_writeWords($words){
      * User wants to encrypt the file. So be it.
      * Get the user's password to use as a key.
      */
-    global $key, $onetimepad;
+    sqgetGlobalVar('key', $key, SQ_COOKIE);
+    sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+
     $clear_key=OneTimePadDecrypt($key, $onetimepad);
     /**
      * Try encrypting it. If fails, scream bloody hell.