Merge pull request #12552 from nextcloud/fix/11146/respect_disabled_password_reset

Respect the disabled setting for lost_password_link
This commit is contained in:
Roeland Jago Douma 2018-11-20 15:52:32 +01:00 committed by GitHub
commit e73bfd5331
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -232,7 +232,9 @@ class LoginController extends Controller {
$parameters['resetPasswordLink'] = $this->config
->getSystemValue('lost_password_link', '');
if (!$parameters['resetPasswordLink'] && $userObj !== null) {
if ($parameters['resetPasswordLink'] === 'disabled') {
$parameters['canResetPassword'] = false;
} else if (!$parameters['resetPasswordLink'] && $userObj !== null) {
$parameters['canResetPassword'] = $userObj->canChangePassword();
} else if ($userObj !== null && $userObj->isEnabled() === false) {
$parameters['canResetPassword'] = false;