Convert mnemo to Horde_Session
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 17 Nov 2010 20:24:08 +0000 (13:24 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 18 Nov 2010 16:39:15 +0000 (09:39 -0700)
mnemo/lib/Mnemo.php

index 45a4383..11f9e38 100644 (file)
@@ -379,8 +379,8 @@ class Mnemo {
      */
     function getPassphrase($id)
     {
-        if (isset($_SESSION['mnemo'][$id]['passphrase'])) {
-            return Horde_Secret::read(Horde_Secret::getKey('mnemo'), $_SESSION['mnemo'][$id]['passphrase']);
+        if ($passphrase = $GLOBALS['session']->get('mnemo', 'passphrase/' . $id)) {
+            return Horde_Secret::read(Horde_Secret::getKey('mnemo'), $passphrase);
         }
     }
 
@@ -395,7 +395,7 @@ class Mnemo {
      */
     function storePassphrase($id, $passphrase)
     {
-        $_SESSION['mnemo'][$id]['passphrase'] = Horde_Secret::write(Horde_Secret::getKey('mnemo'), $passphrase);
+        $GLOBALS['session']->set('mnemo', 'passphrase/' . $id, Horde_Secret::write(Horde_Secret::getKey('mnemo'), $passphrase));
     }
 
     /**