summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-05-19 15:58:30 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-05-19 15:58:30 +0200
commit04e6c12fe220171fc2e3c0f634915e7511cafa92 (patch)
tree5d572fd5914f796231ea3ed34271689c3c0c4ef4 /lib
parent6c4b650524c4a8655984b89d4e7d105cfa61808c (diff)
parent75bc25f906c9b5f1cb0f1da8f3ec05b5e42deb9b (diff)
downloadnextcloud-server-04e6c12fe220171fc2e3c0f634915e7511cafa92.tar.gz
nextcloud-server-04e6c12fe220171fc2e3c0f634915e7511cafa92.zip
Merge pull request #8557 from owncloud/custom_session_handling
Allow apps to create custom session handlers.
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php
index f3a15e0355f..aa5a9d0010a 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -350,9 +350,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
@@ -509,6 +517,7 @@ class OC {
self::$server = new \OC\Server();
self::initTemplateEngine();
+ OC_App::loadApps(array('session'));
if (!self::$CLI) {
self::initSession();
} else {