diff --git a/datamodels/2.x/itop-portal-base/portal/src/Form/PasswordFormManager.php b/datamodels/2.x/itop-portal-base/portal/src/Form/PasswordFormManager.php index ef1f15205..4ac5ea048 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Form/PasswordFormManager.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Form/PasswordFormManager.php @@ -142,6 +142,11 @@ class PasswordFormManager extends FormManager $aData['valid'] = false; $aData['messages']['error'] += array('confirm_password' => array(Dict::S('UI:Login:RetypePwdDoesNotMatch'))); } + elseif ($sNewPassword === $sOldPassword) + { + $aData['valid'] = false; + $aData['messages']['error'] += array('new_password' => array(Dict::S('UI:Login:PasswordNotChanged'))); + } else { try { diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php index 22d6d3eee..8111183b8 100644 --- a/dictionaries/en.dictionary.itop.ui.php +++ b/dictionaries/en.dictionary.itop.ui.php @@ -631,6 +631,7 @@ We hope you’ll enjoy this version as much as we enjoyed imagining and creating 'UI:LogOff:ClickHereToLoginAgain' => 'Click here to login again...', 'UI:ChangePwdMenu' => 'Change Password...', 'UI:Login:PasswordChanged' => 'Password successfully set!', + 'UI:Login:PasswordNotChanged' => 'Error Password is the same!', 'UI:AccessRO-All' => ITOP_APPLICATION.' is read-only', 'UI:AccessRO-Users' => ITOP_APPLICATION.' is read-only for end-users', 'UI:ApplicationEnvironment' => 'Application environment: %1$s', diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index 369d79479..dc73bae2b 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -575,6 +575,7 @@ Nous espérons que vous aimerez cette version autant que nous avons eu du plaisi 'UI:LogOff:ClickHereToLoginAgain' => 'Cliquez ici pour vous reconnecter...', 'UI:ChangePwdMenu' => 'Changer de mot de passe...', 'UI:Login:PasswordChanged' => 'Mot de passe mis à jour !', + 'UI:Login:PasswordNotChanged' => 'Erreur : le mot de passe est identique !', 'UI:AccessRO-All' => ITOP_APPLICATION_SHORT.' est en lecture seule', 'UI:AccessRO-Users' => ITOP_APPLICATION_SHORT.' est en lecture seule pour les utilisateurs finaux', 'UI:ApplicationEnvironment' => 'Environnement applicatif: %1$s', diff --git a/templates/pages/login/password/changepwdform.js.twig b/templates/pages/login/password/changepwdform.js.twig index f360cba18..9a802d097 100644 --- a/templates/pages/login/password/changepwdform.js.twig +++ b/templates/pages/login/password/changepwdform.js.twig @@ -8,11 +8,16 @@ function GoBack() function DoCheckPwd() { - if ($('#new_pwd').val() != $('#retype_new_pwd').val()) + var new_pwd = $('#new_pwd').val(); + if (new_pwd !== $('#retype_new_pwd').val()) { alert('{{ 'UI:Login:RetypePwdDoesNotMatch'|dict_s }}'); return false; } + if (new_pwd === $('#old_pwd').val()) { + alert('{{ 'UI:Login:PasswordNotChanged'|dict_s }}'); + return false; + } return true; }