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', ipanel: 'pveAuthADPanel',
syncipanel: 'pveAuthLDAPSyncPanel', syncipanel: 'pveAuthLDAPSyncPanel',
add: true, add: true,
tfa: true,
}, },
ldap: { ldap: {
name: gettext('LDAP Server'), name: gettext('LDAP Server'),
ipanel: 'pveAuthLDAPPanel', ipanel: 'pveAuthLDAPPanel',
syncipanel: 'pveAuthLDAPSyncPanel', syncipanel: 'pveAuthLDAPSyncPanel',
add: true, add: true,
tfa: true,
}, },
pam: { pam: {
name: 'Linux PAM', name: 'Linux PAM',
ipanel: 'pveAuthBasePanel', ipanel: 'pveAuthBasePanel',
add: false, add: false,
tfa: true,
}, },
pve: { pve: {
name: 'Proxmox VE authentication server', name: 'Proxmox VE authentication server',

View File

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