[Pkg-owncloud-commits] [owncloud] 63/153: Allow apps to create custom session handlers.

David Prévot taffit at moszumanska.debian.org
Tue May 27 03:05:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 75bc25f906c9b5f1cb0f1da8f3ec05b5e42deb9b
Author: ringmaster <epithet at gmail.com>
Date:   Mon May 12 11:08:28 2014 -0400

    Allow apps to create custom session handlers.
---
 lib/base.php | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/base.php b/lib/base.php
index f8266ac..d011a2e 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -378,9 +378,17 @@ class OC {
 		//set the session object to a dummy session so code relying on the session existing still works
 		self::$session = new \OC\Session\Memory('');
 
+		// Let the session name be changed in the initSession Hook
+		$sessionName = OC_Util::getInstanceId();
+
 		try {
-			// set the session name to the instance id - which is unique
-			self::$session = new \OC\Session\Internal(OC_Util::getInstanceId());
+			// Allow session apps to create a custom session object
+			$useCustomSession = false;
+			OC_Hook::emit('OC', 'initSession', array('session' => &self::$session, 'sessionName' => &$sessionName, 'useCustomSession' => &$useCustomSession));
+			if(!$useCustomSession) {
+				// set the session name to the instance id - which is unique
+				self::$session = new \OC\Session\Internal($sessionName);
+			}
 			// if session cant be started break with http 500 error
 		} catch (Exception $e) {
 			//show the user a detailed error page
@@ -537,6 +545,7 @@ class OC {
 		self::$server = new \OC\Server();
 
 		self::initTemplateEngine();
+		OC_App::loadApps(array('session'));
 		if (!self::$CLI) {
 			self::initSession();
 		} else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list