[pve-devel] [PATCH manager 3/6] ui: dc/UserView: disable TFA button based on realm type

Dominik Csapak d.csapak at proxmox.com
Thu Jul 1 14:25:03 CEST 2021


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/UserView.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/www/manager6/dc/UserView.js b/www/manager6/dc/UserView.js
index 244c30f6..20ae3090 100644
--- a/www/manager6/dc/UserView.js
+++ b/www/manager6/dc/UserView.js
@@ -72,6 +72,15 @@ Ext.define('PVE.dc.UserView', {
 	    text: 'TFA',
 	    disabled: true,
 	    selModel: sm,
+	    enableFn: function(record) {
+		if (record.data.realmtype) {
+		    let type = record.data.realmtype;
+		    if (PVE.Utils.authSchema[type]) {
+			return !!PVE.Utils.authSchema[type].tfa;
+		    }
+		}
+		return false;
+	    },
 	    handler: function(btn, event, rec) {
 		var d = rec.data;
 		var tfa_type = PVE.Parser.parseTfaType(d.keys);
-- 
2.30.2






More information about the pve-devel mailing list