Merge pull request #5665 from GitHubUser4234/ldap_password_renew_nc12fix_backport

[stable12] Ldap password renewal fixes for NC12
This commit is contained in:
Morris Jobke 2017-07-10 15:03:31 +02:00 committed by GitHub
commit 5fcf2d2bad
4 changed files with 8 additions and 2 deletions

View File

@ -18,3 +18,8 @@
#renewpassword .title {
background-color: transparent;
}
input.primary,
button.primary {
background-color: #00a2e9 !important;
}

View File

@ -346,7 +346,7 @@ class Access extends LDAPUtility implements IUserTools {
return false;
}
try {
return $this->invokeLDAPMethod('modReplace', $cr, $userDN, $password);
return @$this->invokeLDAPMethod('modReplace', $cr, $userDN, $password);
} catch(ConstraintViolationException $e) {
throw new HintException('Password change rejected.', \OC::$server->getL10N('user_ldap')->t('Password change rejected. Hint: ').$e->getMessage(), $e->getCode());
}

View File

@ -45,6 +45,7 @@ class Application extends App {
$c->query('UserManager'),
$server->getConfig(),
$c->query('OCP\IL10N'),
$c->query('Session'),
$server->getURLGenerator()
);
});

View File

@ -146,7 +146,7 @@ class RenewPasswordController extends Controller {
$this->session->set('loginMessages', [
[], [$this->l10n->t("Please login with the new password")]
]);
$this->session->remove('needPasswordRenewal');
$this->config->setUserValue($user, 'user_ldap', 'needsPasswordReset', 'false');
return new RedirectResponse($this->urlGenerator->linkToRoute('core.login.showLoginForm', $args));
} else {
$this->session->set('renewPasswordMessages', [