[pve-devel] [PATCH manager 3/3] ui: user edit: prohibit editing keys option

Fiona Ebner f.ebner at proxmox.com
Fri Feb 9 14:08:21 CET 2024


by turning the field into a displayfield. The TFA configuration
window should be used to set second factors. It's still worth showing
the field in case it's a legacy value.

Editing a secret that was originally synced from LDAP is a use case
where editing the field might've still made sense, but it's arguably
better to do that on the LDAP side then and re-sync.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 www/manager6/dc/UserEdit.js | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/www/manager6/dc/UserEdit.js b/www/manager6/dc/UserEdit.js
index ca701312..c9b32773 100644
--- a/www/manager6/dc/UserEdit.js
+++ b/www/manager6/dc/UserEdit.js
@@ -128,7 +128,7 @@ Ext.define('PVE.dc.UserEdit', {
 	    ],
 	    advancedItems: [
 		{
-		    xtype: 'textfield',
+		    xtype: 'displayfield',
 		    name: 'keys',
 		    fieldLabel: gettext('Key IDs'),
 		},
@@ -161,18 +161,7 @@ Ext.define('PVE.dc.UserEdit', {
 		success: function(response, options) {
 		    var data = response.result.data;
 		    me.setValues(data);
-		    if (data.keys) {
-			if (data.keys === 'x' ||
-			    data.keys === 'x!oath' ||
-			    data.keys === 'x!u2f' ||
-			    data.keys === 'x!yubico') {
-			    me.down('[name="keys"]').setDisabled(1);
-			}
-			if (data.keys === 'x') {
-			    me.down('[name="keys"]').setHidden(true);
-			}
-		    } else {
-			me.down('[name="keys"]').setDisabled(true);
+		    if (!data.keys || data.keys === 'x') {
 			me.down('[name="keys"]').setHidden(true);
 		    }
 		},
-- 
2.39.2





More information about the pve-devel mailing list