From 40c3c5f412af1f752b3bf42884aed3117eb07445 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 2 Jul 2010 12:36:54 -0600 Subject: [PATCH] Initialize session in Horde_Registry::setupSessionHandler() --- framework/Core/lib/Horde/Registry.php | 9 +++++++-- framework/SyncML/SyncML/Backend/Horde.php | 2 +- horde/bin/active_sessions | 2 +- horde/login.php | 1 - 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 5e0af87f8..092f52c66 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -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(); + } } /** diff --git a/framework/SyncML/SyncML/Backend/Horde.php b/framework/SyncML/SyncML/Backend/Horde.php index ac973a05a..576b767e9 100644 --- a/framework/SyncML/SyncML/Backend/Horde.php +++ b/framework/SyncML/SyncML/Backend/Horde.php @@ -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); diff --git a/horde/bin/active_sessions b/horde/bin/active_sessions index a536192f9..e47b105a9 100755 --- a/horde/bin/active_sessions +++ b/horde/bin/active_sessions @@ -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.'); } diff --git a/horde/login.php b/horde/login.php index d283acaab..78c420fd8 100644 --- a/horde/login.php +++ b/horde/login.php @@ -166,7 +166,6 @@ if ($error_reason) { } $registry->setupSessionHandler(); - @session_start(); Horde_Nls::setLanguageEnvironment($language, $vars->app); -- 2.11.0