Convert to new Horde_Secret package.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 11 Dec 2008 22:19:32 +0000 (15:19 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 11 Dec 2008 22:19:32 +0000 (15:19 -0700)
imp/lib/Compose.php
imp/lib/Crypt/pgp.php
imp/lib/Crypt/smime.php
imp/lib/IMP.php
imp/lib/Quota.php
imp/lib/Session.php
imp/lib/api.php
imp/lib/base.php
imp/login.php
imp/redirect.php
imp/scripts/custom_login.php

index ca3d2e9..680974b 100644 (file)
@@ -669,7 +669,7 @@ class IMP_Compose
          * well. */
         if (!empty($params['auth']) && empty($params['username'])) {
             $params['username'] = $_SESSION['imp']['user'];
-            $params['password'] = Secret::read(IMP::getAuthKey(), $_SESSION['imp']['pass']);
+            $params['password'] = Horde_Secret::read(IMP::getAuthKey(), $_SESSION['imp']['pass']);
         }
 
         return $message->send($email, $headers, $conf['mailer']['type'], $params);
index 279bfb3..a25c966 100644 (file)
@@ -380,7 +380,7 @@ class IMP_Horde_Crypt_pgp extends Horde_Crypt_pgp
         }
 
         return isset($_SESSION['imp']['cache']['pgp'][$type][$id])
-            ? Secret::read(IMP::getAuthKey(), $_SESSION['imp']['cache']['pgp'][$type][$id])
+            ? Horde_Secret::read(IMP::getAuthKey(), $_SESSION['imp']['cache']['pgp'][$type][$id])
             : null;
     }
 
@@ -404,7 +404,7 @@ class IMP_Horde_Crypt_pgp extends Horde_Crypt_pgp
             $id = 'personal';
         }
 
-        $_SESSION['imp']['cache']['pgp'][$type][$id] = Secret::write(IMP::getAuthKey(), $passphrase);
+        $_SESSION['imp']['cache']['pgp'][$type][$id] = Horde_Secret::write(IMP::getAuthKey(), $passphrase);
         return true;
     }
 
index c8f3352..1357430 100644 (file)
@@ -277,7 +277,7 @@ class IMP_Horde_Crypt_smime extends Horde_Crypt_smime
         }
 
         if (isset($_SESSION['imp']['smime']['passphrase'])) {
-            return Secret::read(IMP::getAuthKey(), $_SESSION['imp']['smime']['passphrase']);
+            return Horde_Secret::read(IMP::getAuthKey(), $_SESSION['imp']['smime']['passphrase']);
         } elseif (isset($_SESSION['imp']['smime']['null_passphrase'])) {
             return ($_SESSION['imp']['smime']['null_passphrase']) ? null : false;
         } else {
@@ -306,7 +306,7 @@ class IMP_Horde_Crypt_smime extends Horde_Crypt_smime
         if (!isset($_SESSION['imp']['smime'])) {
             $_SESSION['imp']['smime'] = array();
         }
-        $_SESSION['imp']['smime']['passphrase'] = Secret::write(IMP::getAuthKey(), $passphrase);
+        $_SESSION['imp']['smime']['passphrase'] = Horde_Secret::write(IMP::getAuthKey(), $passphrase);
 
         return true;
     }
index a774352..7fc0a8b 100644 (file)
@@ -1819,7 +1819,7 @@ class IMP
         $key = &self::$_authkey;
 
         if (is_null($key)) {
-            $key = Secret::getKey(Auth::getProvider() == 'imp' ? 'auth' : 'imp');
+            $key = Horde_Secret::getKey(Auth::getProvider() == 'imp' ? 'auth' : 'imp');
         }
         return $key;
     }
index cb69768..73ad5e1 100644 (file)
@@ -79,7 +79,7 @@ class IMP_Quota
         /* If 'password' exists in params, it has been encrypted in the
          * session so we need to decrypt. */
         if (isset($this->_params['password'])) {
-            $this->_params['password'] = Secret::read(IMP::getAuthKey(), $this->_params['password']);
+            $this->_params['password'] = Horde_Secret::read(IMP::getAuthKey(), $this->_params['password']);
         }
     }
 
index 5b8fbc3..a604bb2 100644 (file)
@@ -130,7 +130,7 @@ class IMP_Session
                     /* 'admin' and 'quota' have password entries - encrypt
                      * these entries in the session if they exist. */
                     if (isset($ptr[$val]['params']['password'])) {
-                        $sess['imap'][$val]['params']['password'] = Secret::write(IMP::getAuthKey(), $ptr[$val]['params']['password']);
+                        $sess['imap'][$val]['params']['password'] = Horde_Secret::write(IMP::getAuthKey(), $ptr[$val]['params']['password']);
                     }
                 }
             }
index 8842f06..b5650e3 100644 (file)
@@ -318,11 +318,10 @@ function _imp_userList()
 function _imp_adminDo($task, $params)
 {
     require_once 'Horde/IMAP/Admin.php';
-    require_once 'Horde/Secret.php';
 
     $admin_params = $_SESSION['imp']['admin']['params'];
     $admin_params['admin_user'] = $admin_params['login'];
-    $admin_params['admin_password'] = Secret::read(IMP::getAuthKey(), $admin_params['password']);
+    $admin_params['admin_password'] = Horde_Secret::read(IMP::getAuthKey(), $admin_params['password']);
     $imap = new IMAP_Admin($admin_params);
 
     switch ($task) {
index 3f64b6a..0373aec 100644 (file)
@@ -175,9 +175,6 @@ if (($viewmode == 'dimp') && Util::nonInputVar('dimp_logout')) {
     Horde::redirect(str_replace('&amp;', '&', IMP::getLogoutUrl()));
 }
 
-// Horde libraries.
-require_once 'Horde/Secret.php';
-
 // Initialize global $imp_mbox array.
 $GLOBALS['imp_mbox'] = IMP::getCurrentMailboxInfo();
 
index 9b828b0..c8cf413 100644 (file)
@@ -117,7 +117,7 @@ if (!empty($conf['auth']['alternate_login'])) {
 
 /* Initialize the password key. If we are doing Horde auth as well,
  * make sure that the Horde auth key gets set instead. */
-Secret::setKey($imp_auth ? 'auth' : 'imp');
+Horde_Secret::setKey($imp_auth ? 'auth' : 'imp');
 
 $autologin = Util::getFormData('autologin', false);
 $server_key = Util::getFormData('server_key', IMP_Session::getAutoLoginServer());
index 7219e3a..ba8d151 100644 (file)
@@ -113,7 +113,7 @@ if (isset($_SESSION['imp']) && is_array($_SESSION['imp'])) {
     /* Make sure that if a username was specified, it is the current
      * username. */
     if ((!is_null($imapuser) && ($imapuser != $_SESSION['imp']['user'])) ||
-        (!is_null($pass) && ($pass != Secret::read(IMP::getAuthKey(), $_SESSION['imp']['pass'])))) {
+        (!is_null($pass) && ($pass != Horde_Secret::read(IMP::getAuthKey(), $_SESSION['imp']['pass'])))) {
 
         /* Disable the old session. */
         unset($_SESSION['imp']);
index 377f162..2b50a2d 100644 (file)
@@ -1,14 +1,10 @@
 <?php
-// CUSTOMIZE THIS
-define('IMP_BASE', '..');
-
 define('AUTH_HANDLER', true);
 $authentication = 'none';
-require_once IMP_BASE . '/lib/base.php';
-require_once IMP_BASE . '/config/servers.php';
+require_once '/lib/base.php';
 
 /* Set up the password encryption token. */
-Secret::setKey(Auth::getProvider() == 'imp' ? 'auth' : 'imp');
+Horde_Secret::setKey(Auth::getProvider() == 'imp' ? 'auth' : 'imp');
 
 /* Use the first server defined in servers.php. */
 // CUSTOMIZE THIS