summaryrefslogtreecommitdiffstats
path: root/lib/private/server.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-08-31 15:50:30 +0200
committerLukas Reschke <lukas@owncloud.com>2014-08-31 15:50:30 +0200
commit8009df0b60c71bac41e4ead9ec8e4e92812e0d75 (patch)
treea937e0948af28bffff46eb08f24c93712032d26a /lib/private/server.php
parent73685892ed6f255a916512863cd5549914d071e1 (diff)
parent3a85767182e04ac013f59d82cc3a8c4d08bab151 (diff)
downloadnextcloud-server-8009df0b60c71bac41e4ead9ec8e4e92812e0d75.tar.gz
nextcloud-server-8009df0b60c71bac41e4ead9ec8e4e92812e0d75.zip
Merge pull request #10420 from owncloud/external-share-self-signed
Make external shares work with imported self signed certificates
Diffstat (limited to 'lib/private/server.php')
-rw-r--r--lib/private/server.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index 28c4fe60856..5d40f1327f6 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -6,6 +6,7 @@ use OC\AppFramework\Http\Request;
use OC\AppFramework\Db\Db;
use OC\AppFramework\Utility\SimpleContainer;
use OC\Cache\UserCache;
+use OC\Security\CertificateManager;
use OC\DB\ConnectionWrapper;
use OC\Files\Node\Root;
use OC\Files\View;
@@ -474,4 +475,21 @@ class Server extends SimpleContainer implements IServerContainer {
function getDb() {
return $this->query('Db');
}
+
+ /**
+ * Get the certificate manager for the user
+ *
+ * @param \OCP\IUser $user (optional) if not specified the current loggedin user is used
+ * @return \OCP\ICertificateManager
+ */
+ function getCertificateManager($user = null) {
+ if (is_null($user)) {
+ $userSession = $this->getUserSession();
+ $user = $userSession->getUser();
+ if (is_null($user)) {
+ return null;
+ }
+ }
+ return new CertificateManager($user);
+ }
}