The UserSession is constructed in the server

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/12185/head
Roeland Jago Douma 8 years ago
parent b2501dbf9a
commit 964ebed86c
No known key found for this signature in database
GPG Key ID: F941078878347C0C
  1. 2
      lib/private/AppFramework/DependencyInjection/DIContainer.php
  2. 5
      lib/private/Server.php

@ -125,8 +125,6 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->query('AppName'));
});
$this->registerAlias(\OC\User\Session::class, \OCP\IUserSession::class);
$this->registerService(IServerContainer::class, function ($c) {
return $this->getServer();
});

@ -361,7 +361,7 @@ class Server extends ServerContainer implements IServerContainer {
});
$this->registerAlias(IProvider::class, Authentication\Token\Manager::class);
$this->registerService(\OCP\IUserSession::class, function (Server $c) {
$this->registerService(\OC\User\Session::class, function (Server $c) {
$manager = $c->getUserManager();
$session = new \OC\Session\Memory('');
$timeFactory = new TimeFactory();
@ -430,7 +430,8 @@ class Server extends ServerContainer implements IServerContainer {
});
return $userSession;
});
$this->registerAlias('UserSession', \OCP\IUserSession::class);
$this->registerAlias(\OCP\IUserSession::class, \OC\User\Session::class);
$this->registerAlias('UserSession', \OC\User\Session::class);
$this->registerAlias(\OCP\Authentication\TwoFactorAuth\IRegistry::class, \OC\Authentication\TwoFactorAuth\Registry::class);

Loading…
Cancel
Save