diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-17 16:53:52 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-17 16:53:52 +0200 |
commit | 72eaf2894a540bc9280e144ba493db7fcde07eac (patch) | |
tree | 441114066799c6e5f4fbe4d766080d7c7c74ee06 | |
parent | 4dbc78705566c3a9062fd4c4f69db60a41c5634b (diff) | |
download | nextcloud-server-72eaf2894a540bc9280e144ba493db7fcde07eac.tar.gz nextcloud-server-72eaf2894a540bc9280e144ba493db7fcde07eac.zip |
performance improvement, check configuration only if no private key exists
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index d40ae95a446..d9221c6e828 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -44,13 +44,18 @@ class Hooks { \OC_Util::setupFS($params['uid']);
}
- //check if all requirements are met
- if(!Helper::checkRequirements() || !Helper::checkConfiguration()) {
- $error_msg = $l->t("Missing requirements.");
- $hint = $l->t('Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.');
- \OC_App::disable('files_encryption');
- \OCP\Util::writeLog('Encryption library', $error_msg . ' ' . $hint, \OCP\Util::ERROR);
- \OCP\Template::printErrorPage($error_msg, $hint);
+ $privateKey = \OCA\Encryption\Keymanager::getPrivateKey($view, $params['uid']);
+
+ // if no private key exists, check server configuration
+ if(!$privateKey) {
+ //check if all requirements are met
+ if(!Helper::checkRequirements() || !Helper::checkConfiguration()) {
+ $error_msg = $l->t("Missing requirements.");
+ $hint = $l->t('Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.');
+ \OC_App::disable('files_encryption');
+ \OCP\Util::writeLog('Encryption library', $error_msg . ' ' . $hint, \OCP\Util::ERROR);
+ \OCP\Template::printErrorPage($error_msg, $hint);
+ }
}
$util = new Util($view, $params['uid']);
|