From ef36710ea71e159845daf36a9d55080035fcd158 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sat, 11 Jun 2022 09:03:03 +0100 Subject: [PATCH] print a better error message when password change is blocked --- public/users/password-change.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public/users/password-change.php b/public/users/password-change.php index 8033a3f5..d129a7a9 100644 --- a/public/users/password-change.php +++ b/public/users/password-change.php @@ -40,9 +40,12 @@ $CONF = Config::getInstance()->getAll(); $smarty->configureTheme($rel_path); -if ($context === 'admin' && !Config::read('forgotten_admin_password_reset') || - $context === 'users' && (!Config::read('forgotten_user_password_reset') || Config::read('mailbox_postpassword_script'))) { - die('Password reset is disabled by configuration option: forgotten_admin_password_reset or mailbox_postpassword_script'); +if ($context === 'admin' && !Config::read('forgotten_admin_password_reset')) { + die('Password change is disabled by configuration option: forgotten_admin_password_reset or mailbox_postpassword_script'); +} + +if ($context === 'users' && (!Config::read('forgotten_user_password_reset') || Config::read('mailbox_postpassword_script'))) { + die('Password change is disabled by configuration option: forgotten_user_password_reset or mailbox_postpassword_script'); } if ($_SERVER['REQUEST_METHOD'] === 'GET') {