public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup 1/2] ui: add missing unlockTfa handler
@ 2023-06-27 10:04 Lukas Wagner
  2023-06-27 10:04 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: fix refresh after TFA unlock Lukas Wagner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lukas Wagner @ 2023-06-27 10:04 UTC (permalink / raw)
  To: pbs-devel; +Cc: Wolfgang Bumiller

From: Wolfgang Bumiller <w.bumiller@proxmox.com>

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
 www/config/UserView.js | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/www/config/UserView.js b/www/config/UserView.js
index 5a5b2f4e..9a0a0b2b 100644
--- a/www/config/UserView.js
+++ b/www/config/UserView.js
@@ -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: {
-- 
2.39.2





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-27 11:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-27 10:04 [pbs-devel] [PATCH proxmox-backup 1/2] ui: add missing unlockTfa handler Lukas Wagner
2023-06-27 10:04 ` [pbs-devel] [PATCH proxmox-backup 2/2] ui: fix refresh after TFA unlock Lukas Wagner
2023-06-27 11:29   ` Dominik Csapak
2023-06-27 11:30     ` Lukas Wagner
2023-06-27 11:28 ` [pbs-devel] [PATCH proxmox-backup 1/2] ui: add missing unlockTfa handler Dominik Csapak
2023-06-27 11:32 ` [pbs-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal