diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-15 22:39:17 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-15 22:39:17 +0200 |
commit | 257ee205bb2398a430849181436083eed428ca77 (patch) | |
tree | 48d4e6151a250e3a66808ead24b7573e65f5f55c /settings | |
parent | 2cafbc803a6e09432bcdea7010543ed968ad5abf (diff) | |
parent | 9727386d8b343b9ab2db7604cee012e359c2c9ad (diff) | |
download | nextcloud-server-257ee205bb2398a430849181436083eed428ca77.tar.gz nextcloud-server-257ee205bb2398a430849181436083eed428ca77.zip |
Merge pull request #15978 from owncloud/feature/fix-encryption-tooltips
[enc2]fixing recovery tooltip
Diffstat (limited to 'settings')
-rw-r--r-- | settings/changepassword/controller.php | 8 | ||||
-rw-r--r-- | settings/controller/userscontroller.php | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/settings/changepassword/controller.php b/settings/changepassword/controller.php index 4a68636d3f8..94323fc2fcc 100644 --- a/settings/changepassword/controller.php +++ b/settings/changepassword/controller.php @@ -113,30 +113,27 @@ class Controller { $recoveryEnabledForUser = false; if ($recoveryAdminEnabled) { $validRecoveryPassword = $keyManager->checkRecoveryPassword($recoveryPassword); - $recoveryEnabledForUser = $recovery->isRecoveryEnabledForUser(); + $recoveryEnabledForUser = $recovery->isRecoveryEnabledForUser($username); } + $l = new \OC_L10n('settings'); if ($recoveryEnabledForUser && $recoveryPassword === '') { - $l = new \OC_L10n('settings'); \OC_JSON::error(array('data' => array( 'message' => $l->t('Please provide an admin recovery password, otherwise all user data will be lost') ))); } elseif ($recoveryEnabledForUser && ! $validRecoveryPassword) { - $l = new \OC_L10n('settings'); \OC_JSON::error(array('data' => array( 'message' => $l->t('Wrong admin recovery password. Please check the password and try again.') ))); } else { // now we know that everything is fine regarding the recovery password, let's try to change the password $result = \OC_User::setPassword($username, $password, $recoveryPassword); if (!$result && $recoveryEnabledForUser) { - $l = new \OC_L10n('settings'); \OC_JSON::error(array( "data" => array( "message" => $l->t("Backend doesn't support password change, but the user's encryption key was successfully updated.") ) )); } elseif (!$result && !$recoveryEnabledForUser) { - $l = new \OC_L10n('settings'); \OC_JSON::error(array("data" => array( "message" => $l->t("Unable to change password" ) ))); } else { \OC_JSON::success(array("data" => array( "username" => $username ))); @@ -147,7 +144,6 @@ class Controller { if (!is_null($password) && \OC_User::setPassword($username, $password)) { \OC_JSON::success(array('data' => array('username' => $username))); } else { - $l = new \OC_L10n('settings'); \OC_JSON::error(array('data' => array('message' => $l->t('Unable to change password')))); } } diff --git a/settings/controller/userscontroller.php b/settings/controller/userscontroller.php index e9ffc36904e..d0b5267e3c8 100644 --- a/settings/controller/userscontroller.php +++ b/settings/controller/userscontroller.php @@ -122,10 +122,10 @@ class UsersController extends Controller { $this->subAdminFactory = $subAdminFactory; // check for encryption state - TODO see formatUserForIndex - $this->isEncryptionAppEnabled = $appManager->isEnabledForUser('files_encryption'); + $this->isEncryptionAppEnabled = $appManager->isEnabledForUser('encryption'); if($this->isEncryptionAppEnabled) { // putting this directly in empty is possible in PHP 5.5+ - $result = $config->getAppValue('files_encryption', 'recoveryAdminEnabled', 0); + $result = $config->getAppValue('encryption', 'recoveryAdminEnabled', 0); $this->isRestoreEnabled = !empty($result); } } @@ -148,7 +148,7 @@ class UsersController extends Controller { if ($this->isEncryptionAppEnabled) { if ($this->isRestoreEnabled) { // check for the users recovery setting - $recoveryMode = $this->config->getUserValue($user->getUID(), 'files_encryption', 'recovery_enabled', '0'); + $recoveryMode = $this->config->getUserValue($user->getUID(), 'encryption', 'recoveryEnabled', '0'); // method call inside empty is possible with PHP 5.5+ $recoveryModeEnabled = !empty($recoveryMode); if ($recoveryModeEnabled) { |