diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-23 10:39:12 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-09-23 10:39:12 +0200 |
commit | f6e8a388a90fff82c16589cf09911ef3aeb4005d (patch) | |
tree | a47f16ed41fa3b884a4d709ef09136a4d0c785d0 /apps/files_encryption/hooks | |
parent | 82cbbb8ab8cfe81559c45905d7fca819d71df346 (diff) | |
parent | 9851f0f4f2a97dc6ac1382bcd533eb23feffa4e0 (diff) | |
download | nextcloud-server-f6e8a388a90fff82c16589cf09911ef3aeb4005d.tar.gz nextcloud-server-f6e8a388a90fff82c16589cf09911ef3aeb4005d.zip |
Merge branch 'master' into encryption_improved_error_messages_4617
Conflicts:
settings/ajax/changepassword.php
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 9824cb45684..2df860a8e57 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -44,17 +44,22 @@ class Hooks { \OC_Util::setupFS($params['uid']);
}
- $util = new Util($view, $params['uid']);
-
- //check if all requirements are met
- if(!$util->ready() && (!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']);
+
// setup user, if user not ready force relogin
if (Helper::setupUser($util, $params['password']) === false) {
return false;
|