diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-20 12:59:04 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-08-21 17:59:23 +0200 |
commit | 36eef2ddabd77ff6279f3bd6896ced4959f1c370 (patch) | |
tree | 82f28ac58905ed449d5678ffb505eec4d3ec7fde /lib/base.php | |
parent | 510010e774c4019b7fc616c90085649abb7afac3 (diff) | |
download | nextcloud-server-36eef2ddabd77ff6279f3bd6896ced4959f1c370.tar.gz nextcloud-server-36eef2ddabd77ff6279f3bd6896ced4959f1c370.zip |
Add a session wrapper to encrypt the data before storing it on disk
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/base.php b/lib/base.php index 42e1d7f8586..98305a19df2 100644 --- a/lib/base.php +++ b/lib/base.php @@ -463,13 +463,15 @@ class OC { $useCustomSession = false; $session = self::$server->getSession(); OC_Hook::emit('OC', 'initSession', array('session' => &$session, 'sessionName' => &$sessionName, 'useCustomSession' => &$useCustomSession)); - if($useCustomSession) { - // use the session reference as the new Session - self::$server->setSession($session); - } else { + if (!$useCustomSession) { // set the session name to the instance id - which is unique - self::$server->setSession(new \OC\Session\Internal($sessionName)); + $session = new \OC\Session\Internal($sessionName); } + + $cryptoWrapper = \OC::$server->getSessionCryptoWrapper(); + $session = $cryptoWrapper->wrapSession($session); + self::$server->setSession($session); + // if session cant be started break with http 500 error } catch (Exception $e) { \OCP\Util::logException('base', $e); |