From f8f3c9ecf9da1f14722f6d3266a0e80ea157f98f Mon Sep 17 00:00:00 2001
From: Joas Schilling
Date: Mon, 7 Dec 2015 15:14:19 +0100
Subject: [PATCH] Remove password reset when the user can not change the
password
---
core/templates/login.php | 8 ++++++--
lib/private/util.php | 6 ++++++
2 files changed, 12 insertions(+), 2 deletions(-)
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));
--
2.39.5