[pve-devel] [PATCH manager] ui: Add verify SSL cert checkbox for active directory

Dominic Jäger d.jaeger at proxmox.com
Tue Oct 27 12:34:25 CET 2020


Like for LDAP, the option is too important to be hidden in CLI.

Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
---
The verify parameter seems to be implemented in the LDAP code [0] as well
as in the AD code [1]

[0] https://git.proxmox.com/?p=pve-access-control.git;a=blob;f=PVE/Auth/LDAP.pm;h=97d077886cd904863b65270580da8f46fb62f376;hb=HEAD#l192
[1] https://git.proxmox.com/?p=pve-access-control.git;a=blob;f=PVE/Auth/AD.pm;h=88b2098355bd3d1bf9cfb32be6ea257083b891d1;hb=HEAD#l118

 www/manager6/dc/AuthEditAD.js | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/www/manager6/dc/AuthEditAD.js b/www/manager6/dc/AuthEditAD.js
index 31a6a360..d70d6f3b 100644
--- a/www/manager6/dc/AuthEditAD.js
+++ b/www/manager6/dc/AuthEditAD.js
@@ -46,9 +46,44 @@ Ext.define('PVE.panel.ADInputPanel', {
 		fieldLabel: 'SSL',
 		name: 'secure',
 		uncheckedValue: 0,
+		listeners: {
+		    change: function(field, newValue) {
+			let verifyCheckbox = field.nextSibling('proxmoxcheckbox[name=verify]');
+			if (newValue === true) {
+			    verifyCheckbox.enable();
+			} else {
+			    verifyCheckbox.disable();
+			    verifyCheckbox.setValue(0);
+			}
+		    },
+		},
+	    },
+	    {
+		xtype: 'proxmoxcheckbox',
+		fieldLabel: gettext('Verify Certificate'),
+		name: 'verify',
+		unceckedValue: 0,
+		disabled: true,
+		checked: false,
+		autoEl: {
+		    tag: 'div',
+		    'data-qtip': gettext('Verify SSL certificate of the server'),
+		},
 	    },
 	];
 
 	me.callParent();
     },
+    onGetValues: function(values) {
+	let me = this;
+
+	if (!values.verify) {
+	    if (!me.isCreate) {
+		Proxmox.Utils.assemble_field_data(values, { 'delete': 'verify' });
+	    }
+	    delete values.verify;
+	}
+
+	return me.callParent([values]);
+    },
 });
-- 
2.20.1





More information about the pve-devel mailing list