diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2015-01-20 17:00:29 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2015-01-26 16:58:52 +0100 |
commit | 67da1f7e5ac9fc5472b6041dcfdc81a4b8428379 (patch) | |
tree | c59843c523ac38af745beadaa0baefec5815d3c0 /lib/private/server.php | |
parent | 66f0db30b2ba97cbe91031b42740dabddc659f0d (diff) | |
download | nextcloud-server-67da1f7e5ac9fc5472b6041dcfdc81a4b8428379.tar.gz nextcloud-server-67da1f7e5ac9fc5472b6041dcfdc81a4b8428379.zip |
certificate manager only needs the user-id, no need to pass on the complete user object
Diffstat (limited to 'lib/private/server.php')
-rw-r--r-- | lib/private/server.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/private/server.php b/lib/private/server.php index c98f77c6479..672245c3528 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -249,7 +249,9 @@ class Server extends SimpleContainer implements IServerContainer { }); $this->registerService('HTTPHelper', function (Server $c) { $config = $c->getConfig(); - return new HTTPHelper($config, new \OC\Security\CertificateManager($c->getUserSession()->getUser())); + $user = $c->getUserSession()->getUser(); + $uid = $user ? $user->getUID() : null; + return new HTTPHelper($config, new \OC\Security\CertificateManager($uid)); }); $this->registerService('EventLogger', function (Server $c) { if (defined('DEBUG') and DEBUG) { @@ -631,18 +633,19 @@ class Server extends SimpleContainer implements IServerContainer { /** * Get the certificate manager for the user * - * @param \OCP\IUser $user (optional) if not specified the current loggedin user is used + * @param string $uid (optional) if not specified the current loggedin user is used * @return \OCP\ICertificateManager */ - function getCertificateManager($user = null) { - if (is_null($user)) { + function getCertificateManager($uid = null) { + if (is_null($uid)) { $userSession = $this->getUserSession(); $user = $userSession->getUser(); if (is_null($user)) { return null; } + $uid = $user->getUID(); } - return new CertificateManager($user); + return new CertificateManager($uid); } /** |