mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-06-13 21:55:54 +00:00
ui: Workspace: use domains info to hide password/tfa items
in the user menu we have to make an additional api call here, since it is the only place (currently) where we can get the realm type Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> [ Thomas: adapt to move of parse_userid to widget-toolkit ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b8dcc6d307
commit
c5be8d39c9
@ -172,6 +172,23 @@ Ext.define('PVE.StdWorkspace', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Proxmox.Utils.API2Request({
|
||||||
|
url: '/access/domains',
|
||||||
|
method: 'GET',
|
||||||
|
success: function(response) {
|
||||||
|
let [_username, realm] = Proxmox.Utils.parse_userid(Proxmox.UserName);
|
||||||
|
response.result.data.forEach((domain) => {
|
||||||
|
if (domain.realm === realm) {
|
||||||
|
let schema = PVE.Utils.authSchema[domain.type];
|
||||||
|
if (schema) {
|
||||||
|
me.query('#tfaitem')[0].setHidden(!schema.tfa);
|
||||||
|
me.query('#passworditem')[0].setHidden(!schema.pwchange);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -353,6 +370,7 @@ Ext.define('PVE.StdWorkspace', {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: gettext('Password'),
|
text: gettext('Password'),
|
||||||
|
itemId: 'passworditem',
|
||||||
iconCls: 'fa fa-fw fa-key',
|
iconCls: 'fa fa-fw fa-key',
|
||||||
handler: function() {
|
handler: function() {
|
||||||
var win = Ext.create('Proxmox.window.PasswordEdit', {
|
var win = Ext.create('Proxmox.window.PasswordEdit', {
|
||||||
@ -363,6 +381,7 @@ Ext.define('PVE.StdWorkspace', {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'TFA',
|
text: 'TFA',
|
||||||
|
itemId: 'tfaitem',
|
||||||
iconCls: 'fa fa-fw fa-lock',
|
iconCls: 'fa fa-fw fa-lock',
|
||||||
handler: function(btn, event, rec) {
|
handler: function(btn, event, rec) {
|
||||||
var win = Ext.create('PVE.window.TFAEdit', {
|
var win = Ext.create('PVE.window.TFAEdit', {
|
||||||
|
Loading…
Reference in New Issue
Block a user