]> source.dussan.org Git - nextcloud-server.git/commitdiff
Respect the disabled setting for lost_password_link 12552/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Tue, 20 Nov 2018 12:28:40 +0000 (13:28 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 20 Nov 2018 12:28:40 +0000 (13:28 +0100)
Fixes #11146
As documented when it is set to disabled the user can't request a lost
password.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
core/Controller/LoginController.php

index d34f243f15f6eb4c17a846061ac69fd7c5bd8047..40e13b43c80f06a6db881de5a1a316796e838eab 100644 (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;