mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-05 11:04:42 +00:00
ui: add missing unlockTfa handler
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Reviewed-by: Dominik Csapak <d.csapak@proxmox.com> Tested-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
5414850a66
commit
e01b9c45c5
@ -100,6 +100,30 @@ Ext.define('PBS.config.UserView', {
|
||||
init: function(view) {
|
||||
Proxmox.Utils.monStoreErrors(view, view.getStore().rstore);
|
||||
},
|
||||
|
||||
unlockTfa: function(btn, event, rec) {
|
||||
let me = this;
|
||||
let view = me.getView();
|
||||
Ext.Msg.confirm(
|
||||
Ext.String.format(gettext('Unlock TFA authentication for {0}'), rec.data.userid),
|
||||
gettext("Locked 2nd factors can happen if the user's password was leaked. Are you sure you want to unlock the user?"),
|
||||
function(btn_response) {
|
||||
if (btn_response === 'yes') {
|
||||
Proxmox.Utils.API2Request({
|
||||
url: `/access/users/${rec.data.userid}/unlock-tfa`,
|
||||
waitMsgTarget: view,
|
||||
method: 'PUT',
|
||||
failure: function(response, options) {
|
||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
||||
},
|
||||
success: function(response, options) {
|
||||
me.reload();
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
listeners: {
|
||||
|
Loading…
Reference in New Issue
Block a user