Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/server.php')
-rw-r--r--lib/private/server.php42
1 files changed, 14 insertions, 28 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index 89001567219..61eb3c736bf 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -56,6 +56,7 @@ use OC\Security\Crypto;
use OC\Security\Hasher;
use OC\Security\SecureRandom;
use OC\Security\TrustedDomainHelper;
+use OC\Session\CryptoWrapper;
use OC\Tagging\TagMapper;
use OCP\IServerContainer;
use Symfony\Component\EventDispatcher\EventDispatcher;
@@ -159,7 +160,12 @@ class Server extends SimpleContainer implements IServerContainer {
});
$this->registerService('UserSession', function (Server $c) {
$manager = $c->getUserManager();
- $userSession = new \OC\User\Session($manager, new \OC\Session\Memory(''));
+
+ $session = new \OC\Session\Memory('');
+ $cryptoWrapper = $c->getSessionCryptoWrapper();
+ $session = $cryptoWrapper->wrapSession($session);
+
+ $userSession = new \OC\User\Session($manager, $session);
$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
});
@@ -461,6 +467,13 @@ class Server extends SimpleContainer implements IServerContainer {
$this->registerService('EventDispatcher', function() {
return new EventDispatcher();
});
+ $this->registerService('CryptoWrapper', function (Server $c) {
+ return new CryptoWrapper(
+ $c->getConfig(),
+ $c->getCrypto(),
+ $c->getSecureRandom()
+ );
+ });
}
/**
@@ -949,31 +962,4 @@ class Server extends SimpleContainer implements IServerContainer {
return $this->query('MountManager');
}
- /*
- * Get the MimeTypeDetector
- *
- * @return \OCP\Files\IMimeTypeDetector
- */
- public function getMimeTypeDetector() {
- return $this->query('MimeTypeDetector');
- }
-
- /**
- * Get the manager of all the capabilities
- *
- * @return \OC\CapabilitiesManager
- */
- public function getCapabilitiesManager() {
- return $this->query('CapabilitiesManager');
- }
-
- /**
- * Get the EventDispatcher
- *
- * @return EventDispatcherInterface
- * @since 8.2.0
- */
- public function getEventDispatcher() {
- return $this->query('EventDispatcher');
- }
}