]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: dc/UserView: disable Password button based on realm type
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 1 Jul 2021 12:25:04 +0000 (14:25 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 2 Jul 2021 12:10:19 +0000 (14:10 +0200)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Utils.js
www/manager6/dc/UserView.js

index 8b061c59d4bb54e8fe2b528f4b2c4d46d9ecb973..271f89b7083a0f2259fa5f82384d649ade36c9c0 100644 (file)
@@ -734,6 +734,7 @@ Ext.define('PVE.Utils', {
            syncipanel: 'pveAuthLDAPSyncPanel',
            add: true,
            tfa: true,
+           pwchange: true,
        },
        ldap: {
            name: gettext('LDAP Server'),
@@ -741,23 +742,27 @@ Ext.define('PVE.Utils', {
            syncipanel: 'pveAuthLDAPSyncPanel',
            add: true,
            tfa: true,
+           pwchange: true,
        },
        openid: {
            name: gettext('OpenID Server'),
            ipanel: 'pveAuthOpenIDPanel',
            add: true,
            tfa: false,
+           pwchange: false,
        },
        pam: {
            name: 'Linux PAM',
            ipanel: 'pveAuthBasePanel',
            add: false,
            tfa: true,
+           pwchange: true,
        },
        pve: {
            name: 'Proxmox VE authentication server',
            ipanel: 'pveAuthBasePanel',
            add: false,
+           pwchange: true,
        },
     },
 
index 20ae30906e2c9a722792f1fb3d9128784c504878..957b772459b16a5957421ff107f9306a39b5d180 100644 (file)
@@ -58,6 +58,15 @@ Ext.define('PVE.dc.UserView', {
            text: gettext('Password'),
            disabled: true,
            selModel: sm,
+           enableFn: function(record) {
+               if (record.data.realmtype) {
+                   let type = record.data.realmtype;
+                   if (PVE.Utils.authSchema[type]) {
+                       return !!PVE.Utils.authSchema[type].pwchange;
+                   }
+               }
+               return false;
+           },
            handler: function(btn, event, rec) {
                Ext.create('Proxmox.window.PasswordEdit', {
                    userid: rec.data.userid,