]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
window: password edit: add opt-in confirmation-password field
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 15 Mar 2024 11:55:09 +0000 (12:55 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 21 Mar 2024 16:30:27 +0000 (17:30 +0100)
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>
src/window/PasswordEdit.js

index 5ab15178b40de4c235708f8d3b52cbadbc24db8d..fc7f68a32ef236fde3236ea04d62860580cfda3f 100644 (file)
@@ -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',