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 <security@wth-security.nl>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
 [ TL: use already included CBind mixin instead of constructor ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2024-03-15 12:55:09 +01:00 committed by Thomas Lamprecht
parent d35cb8aa7c
commit be5b9a4393

View File

@ -11,7 +11,23 @@ Ext.define('Proxmox.window.PasswordEdit', {
labelWidth: 120, labelWidth: 120,
}, },
// allow products to opt-in as their API gains support for this.
confirmCurrentPassword: false,
items: [ 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', xtype: 'textfield',
inputType: 'password', inputType: 'password',