ui: dc/AuthEditBase: only add tfa field on auth modes that support that

for now that are all, but we will ad one where that is not possible

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-07-01 14:25:01 +02:00 committed by Thomas Lamprecht
parent 3dd99bab1f
commit 550857eb16
2 changed files with 12 additions and 5 deletions

View File

@ -733,17 +733,20 @@ Ext.define('PVE.Utils', {
ipanel: 'pveAuthADPanel',
syncipanel: 'pveAuthLDAPSyncPanel',
add: true,
tfa: true,
},
ldap: {
name: gettext('LDAP Server'),
ipanel: 'pveAuthLDAPPanel',
syncipanel: 'pveAuthLDAPSyncPanel',
add: true,
tfa: true,
},
pam: {
name: 'Linux PAM',
ipanel: 'pveAuthBasePanel',
add: false,
tfa: true,
},
pve: {
name: 'Proxmox VE authentication server',

View File

@ -24,6 +24,8 @@ Ext.define('PVE.panel.AuthBase', {
initComponent: function() {
let me = this;
let options = PVE.Utils.authSchema[me.type];
if (!me.column1) { me.column1 = []; }
if (!me.column2) { me.column2 = []; }
if (!me.columnB) { me.columnB = []; }
@ -45,11 +47,13 @@ Ext.define('PVE.panel.AuthBase', {
uncheckedValue: 0,
});
// last field of column2is tfa
me.column2.push({
xtype: 'pveTFASelector',
deleteEmpty: !me.isCreate,
});
if (options.tfa) {
// last field of column2is tfa
me.column2.push({
xtype: 'pveTFASelector',
deleteEmpty: !me.isCreate,
});
}
me.columnB.push({
xtype: 'textfield',