From: Joas Schilling Date: Mon, 7 Dec 2015 14:14:19 +0000 (+0100) Subject: Remove password reset when the user can not change the password X-Git-Tag: v9.0beta1~550^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f8f3c9ecf9da1f14722f6d3266a0e80ea157f98f;p=nextcloud-server.git Remove password reset when the user can not change the password --- diff --git a/core/templates/login.php b/core/templates/login.php index 03be6258fdf..7b09d4fac95 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -56,11 +56,15 @@ script('core', [

- + t('Wrong password. Reset it?')); ?> - + +

+ t('Wrong password.')); ?> +

+
diff --git a/lib/private/util.php b/lib/private/util.php index 9929b7d5b1c..532730998c6 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -947,6 +947,12 @@ class OC_Util { $parameters['redirect_url'] = $_REQUEST['redirect_url']; } + $parameters['canResetPassword'] = true; + $user = \OC::$server->getUserManager()->get($_REQUEST['user']); + if ($user instanceof IUser) { + $parameters['canResetPassword'] = $user->canChangePassword(); + } + $parameters['alt_login'] = OC_App::getAlternativeLogIns(); $parameters['rememberLoginAllowed'] = self::rememberLoginAllowed(); \OC_Hook::emit('OC_Util', 'pre_displayLoginPage', array('parameters' => $parameters));