From be5b9a43930d6224c244c5654d5328842bfc944b Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 15 Mar 2024 12:55:09 +0100 Subject: [PATCH] window: password edit: add opt-in confirmation-password field For when the product UI using this component wants to show an extra confirmation field where the user that executes the password change, have to confirm their own password. Reported-by: Wouter Arts Signed-off-by: Wolfgang Bumiller [ TL: use already included CBind mixin instead of constructor ] Signed-off-by: Thomas Lamprecht --- src/window/PasswordEdit.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/window/PasswordEdit.js b/src/window/PasswordEdit.js index 5ab1517..fc7f68a 100644 --- a/src/window/PasswordEdit.js +++ b/src/window/PasswordEdit.js @@ -11,7 +11,23 @@ Ext.define('Proxmox.window.PasswordEdit', { labelWidth: 120, }, + // allow products to opt-in as their API gains support for this. + confirmCurrentPassword: false, + items: [ + { + xtype: 'textfield', + inputType: 'password', + fieldLabel: gettext('Current password'), + reference: 'confirmation-password', + name: 'confirmation-password', + allowBlank: false, + vtype: 'password', + cbind: { + hidden: '{!confirmCurrentPassword}', + disabled: '{!confirmCurrentPassword}', + }, + }, { xtype: 'textfield', inputType: 'password',