Merge pull request #8557 from owncloud/custom_session_handling

Allow apps to create custom session handlers.
remotes/origin/ldap_group_count
Thomas Müller 2014-05-19 15:58:30 +07:00
commit 04e6c12fe2
1 changed files with 11 additions and 2 deletions

@ -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 {