Remove usage of getFormData() in IMP_Compose::.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 6 Aug 2010 19:32:54 +0000 (13:32 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 6 Aug 2010 19:32:54 +0000 (13:32 -0600)
imp/lib/Application.php
imp/lib/Compose.php

index 64b52cc..7856a6c 100644 (file)
@@ -79,7 +79,7 @@ class IMP_Application extends Horde_Registry_Application
     {
         if (($e->getCode() == Horde_Registry::AUTH_FAILURE) &&
             Horde_Util::getFormData('composeCache')) {
-            $imp_compose = $GLOBALS['injector']->getInstance('IMP_Compose')->getOb()->sessionExpireDraft();
+            $imp_compose = $GLOBALS['injector']->getInstance('IMP_Compose')->getOb()->sessionExpireDraft(Horde_Variables::getDefaultVariables());
         }
     }
 
index 96cd892..d66f6af 100644 (file)
@@ -2653,8 +2653,10 @@ class IMP_Compose
 
     /**
      * Store draft compose data if session expires.
+     *
+     * @param Horde_Variables $vars  Object with the form data.
      */
-    public function sessionExpireDraft()
+    public function sessionExpireDraft($vars)
     {
         if (empty($GLOBALS['conf']['compose']['use_vfs'])) {
             return;
@@ -2664,18 +2666,18 @@ class IMP_Compose
 
         $headers = array();
         foreach (array('to', 'cc', 'bcc', 'subject') as $val) {
-            $headers[$val] = $imp_ui->getAddressList(Horde_Util::getFormData($val));
+            $headers[$val] = $imp_ui->getAddressList($vars->$val);
         }
 
         try {
-            $body = $this->_saveDraftMsg($headers, Horde_Util::getFormData('message', ''), Horde_Util::getFormData('charset'), Horde_Util::getFormData('rtemode'), false);
+            $body = $this->_saveDraftMsg($headers, $vars->message, $vars->charset, $vars->rtemode, false);
         } catch (IMP_Compose_Exception $e) {
             return;
         }
 
         try {
             $vfs = $GLOBALS['injector']->getInstance('Horde_Vfs')->getVfs();
-            $vfs->writeData(self::VFS_DRAFTS_PATH, hash('md5', Horde_Util::getFormData('user')), $body, true);
+            $vfs->writeData(self::VFS_DRAFTS_PATH, hash('md5', $vars->user), $body, true);
 
             $GLOBALS['notification']->push(_("The message you were composing has been saved as a draft. The next time you login, you may resume composing your message."));
         } catch (VFS_Exception $e) {}