diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2015-08-06 16:51:31 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2015-08-30 19:00:03 +0200 |
commit | 37513f9411035f6edcb78f9f89ceb4f8433f0aa5 (patch) | |
tree | 1a5b319c9793e869a41c848e5c8cf16ca241b85a /lib | |
parent | 289e9130f35334a6f0cffcedee82da7d9f5082d0 (diff) | |
download | nextcloud-server-37513f9411035f6edcb78f9f89ceb4f8433f0aa5.tar.gz nextcloud-server-37513f9411035f6edcb78f9f89ceb4f8433f0aa5.zip |
don't read certificates if ownCloud is not installed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/security/certificatemanager.php | 15 | ||||
-rw-r--r-- | lib/private/server.php | 4 | ||||
-rw-r--r-- | lib/private/util.php | 1 |
3 files changed, 17 insertions, 3 deletions
diff --git a/lib/private/security/certificatemanager.php b/lib/private/security/certificatemanager.php index d61c7f29327..4d470f69a66 100644 --- a/lib/private/security/certificatemanager.php +++ b/lib/private/security/certificatemanager.php @@ -27,6 +27,7 @@ namespace OC\Security; use OC\Files\Filesystem; use OCP\ICertificateManager; +use OCP\IConfig; /** * Manage trusted certificates for users @@ -43,12 +44,19 @@ class CertificateManager implements ICertificateManager { protected $view; /** + * @var IConfig + */ + protected $config; + + /** * @param string $uid * @param \OC\Files\View $view relative zu data/ + * @param IConfig $config */ - public function __construct($uid, \OC\Files\View $view) { + public function __construct($uid, \OC\Files\View $view, IConfig $config) { $this->uid = $uid; $this->view = $view; + $this->config = $config; } /** @@ -57,6 +65,11 @@ class CertificateManager implements ICertificateManager { * @return \OCP\ICertificate[] */ public function listCertificates() { + + if (!$this->config->getSystemValue('installed', false)) { + return array(); + } + $path = $this->getPathToCertificates() . 'uploads/'; if (!$this->view->is_dir($path)) { return array(); diff --git a/lib/private/server.php b/lib/private/server.php index 6aab3d26df4..a741f33eb3d 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -339,7 +339,7 @@ class Server extends SimpleContainer implements IServerContainer { $uid = $user ? $user : null; return new ClientService( $c->getConfig(), - new \OC\Security\CertificateManager($uid, new View()) + new \OC\Security\CertificateManager($uid, new View(), $c->getConfig()) ); }); $this->registerService('EventLogger', function (Server $c) { @@ -852,7 +852,7 @@ class Server extends SimpleContainer implements IServerContainer { } $userId = $user->getUID(); } - return new CertificateManager($userId, new View()); + return new CertificateManager($userId, new View(), $this->getConfig()); } /** diff --git a/lib/private/util.php b/lib/private/util.php index edd375b5c36..0fda55496dc 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1145,6 +1145,7 @@ class OC_Util { * @throws \OC\HintException If the test file can't get written. */ public function isHtaccessWorking(\OCP\IConfig $config) { + if (\OC::$CLI || !$config->getSystemValue('check_for_working_htaccess', true)) { return true; } |