From 24c7ce57e1ffb2256eeabe18c487abfcf9bbcbd7 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 7 Aug 2018 11:40:21 +0200 Subject: [PATCH] apply the fix for password change recommended by @sairim --- customize.dist/translations/messages.fr.js | 1 + customize.dist/translations/messages.js | 1 + www/settings/inner.js | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index 851d3648b..010c0f28b 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -606,6 +606,7 @@ define(function () { out.settings_changePasswordConfirm = "Êtes-vous sûr de vouloir changer votre mot de passe ? Vous devrez vous reconnecter sur tous vos appareils."; out.settings_changePasswordError = "Une erreur est survenue. Si vous n'êtes plus en mesure de vous connecter à votre compte utilisateur ou de changer votre mot de passe, veuillez contacter l'administrateur de votre CryptPad."; out.settings_changePasswordPending = "Votre mot de passe est en train d'être modifié. Veuillez ne pas fermer ou recharger cette page avant que le traitement soit terminé."; + out.settings_changePasswordNewPasswordSameAsOld = "Votre nouveau mot de passe doit être différent de votre mot de passe actuel."; out.upload_title = "Hébergement de fichiers"; out.upload_modal_title = "Options d'importation du fichier"; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index ac3ba63fd..27bfce0c3 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -615,6 +615,7 @@ define(function () { out.settings_changePasswordConfirm = "Are you sure you want to change your password? You will need to log back in on all your devices."; out.settings_changePasswordError = "An unexpected error occurred. If you are unable to login or change your password, contact your CryptPad administrators."; out.settings_changePasswordPending = "Your password is being updated. Please do not close or reload this page until the process has completed."; + out.settings_changePasswordNewPasswordSameAsOld = "Your new password must be different than your current password."; out.upload_title = "File upload"; out.upload_modal_title = "File upload options"; diff --git a/www/settings/inner.js b/www/settings/inner.js index 407ee5fdb..b22d194af 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -428,6 +428,10 @@ define([ return; } + if (oldPassword === newPassword) { + return void UI.alert(Messages.settings_changePasswordNewPasswordSameAsOld); + } + UI.confirm(Messages.settings_changePasswordConfirm, function (yes) { if (!yes) { return; }