Initialize session in Horde_Registry::setupSessionHandler()
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 2 Jul 2010 18:36:54 +0000 (12:36 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 2 Jul 2010 18:50:13 +0000 (12:50 -0600)
framework/Core/lib/Horde/Registry.php
framework/SyncML/SyncML/Backend/Horde.php
horde/bin/active_sessions
horde/login.php

index 5e0af87..092f52c 100644 (file)
@@ -352,7 +352,6 @@ class Horde_Registry
             $_SESSION = array();
         } else {
             $this->setupSessionHandler();
-            session_start();
             if ($session_flags & self::SESSION_READONLY) {
                 /* Close the session immediately so no changes can be
                    made but values are still available. */
@@ -1557,9 +1556,11 @@ class Horde_Registry
      * The custom session handler object will be contained in the
      * $sessionHandler public member variable.
      *
+     * @param boolean $start  Initiate the session?
+     *
      * @throws Horde_Exception
      */
-    public function setupSessionHandler()
+    public function setupSessionHandler($start = true)
     {
         global $conf;
 
@@ -1586,6 +1587,10 @@ class Horde_Registry
         /* We want to create an instance here, not get, since we may be
          * destroying the previous instances in the page. */
         $this->sessionHandler = $GLOBALS['injector']->createInstance('Horde_SessionHandler');
+
+        if ($start) {
+            session_start();
+        }
     }
 
     /**
index ac973a0..576b767 100644 (file)
@@ -81,7 +81,7 @@ class SyncML_Backend_Horde extends SyncML_Backend {
         /* Only the server needs to start a session. */
         if ($this->_backendMode == SYNCML_BACKENDMODE_SERVER) {
             /* Reload the Horde SessionHandler if necessary. */
-            $GLOBALS['registry']->setupSessionHandler();
+            $GLOBALS['registry']->setupSessionHandler(false);
         }
 
         parent::sessionStart($syncDeviceID, $sessionId, $backendMode);
index a536192..e47b105 100755 (executable)
@@ -19,7 +19,7 @@ require_once dirname(__FILE__) . '/../lib/Application.php';
 Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true));
 
 /* Check for sessionhandler object. */
-$registry->setupSessionHandler();
+$registry->setupSessionHandler(false);
 if (!$registry->sessionHandler) {
     throw new Horde_Exception('Horde is unable to load the session handler.');
 }
index d283aca..78c420f 100644 (file)
@@ -166,7 +166,6 @@ if ($error_reason) {
     }
 
     $registry->setupSessionHandler();
-    @session_start();
 
     Horde_Nls::setLanguageEnvironment($language, $vars->app);