Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClark Tomlinson <fallen013@gmail.com>2015-04-30 17:44:44 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2015-05-04 10:40:59 +0300
commit3ef2e668ac9274d72ea4afb73b708d7b2c88f0d7 (patch)
treed2dc2f1047cf837cfbdf817f69ca26aef43a38cb /settings/changepassword
parent870ac88c85ffe20db9708b5a4c69fbe18102f0d6 (diff)
fixing recovery tooltip
Diffstat (limited to 'settings/changepassword')
-rw-r--r--settings/changepassword/controller.php6
1 files changed, 1 insertions, 5 deletions
diff --git a/settings/changepassword/controller.php b/settings/changepassword/controller.php
index 4a68636d3f8..e6f928930e9 100644
--- a/settings/changepassword/controller.php
+++ b/settings/changepassword/controller.php
@@ -115,28 +115,25 @@ class Controller {
$validRecoveryPassword = $keyManager->checkRecoveryPassword($recoveryPassword);
$recoveryEnabledForUser = $recovery->isRecoveryEnabledForUser();
}
+ $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'))));
}
}