public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: Fix #2827: Add verify SSL cert checkbox for ldap
@ 2020-10-15 10:00 Dominic Jäger
  2020-10-15 10:00 ` [pve-devel] SPAM: [PATCH docs] pveum: Add information about realm certificates Dominic Jäger
  2020-10-22 16:53 ` [pve-devel] applied: [PATCH manager] ui: Fix #2827: Add verify SSL cert checkbox for ldap Thomas Lamprecht
  0 siblings, 2 replies; 4+ messages in thread
From: Dominic Jäger @ 2020-10-15 10:00 UTC (permalink / raw)
  To: pve-devel

Because the option is too important to be hidden in CLI.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
I haven't managed to test this against an LDAP server yet, but the GUI elements
go on and off as I had it in mind and the options in /etc/pve/domains.cfg
change as expected.

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

diff --git a/www/manager6/dc/AuthEditLDAP.js b/www/manager6/dc/AuthEditLDAP.js
index c5976769..ccaabc4e 100644
--- a/www/manager6/dc/AuthEditLDAP.js
+++ b/www/manager6/dc/AuthEditLDAP.js
@@ -53,11 +53,46 @@ Ext.define('PVE.panel.LDAPInputPanel', {
 		fieldLabel: 'SSL',
 		name: 'secure',
 		uncheckedValue: 0,
+		listeners: {
+		    change: function(me, newValue) {
+			let verifyCheckbox = me.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]);
+    },
 });
 
 Ext.define('PVE.panel.LDAPSyncInputPanel', {
-- 
2.20.1




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

end of thread, other threads:[~2020-10-22 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 10:00 [pve-devel] [PATCH manager] ui: Fix #2827: Add verify SSL cert checkbox for ldap Dominic Jäger
2020-10-15 10:00 ` [pve-devel] SPAM: [PATCH docs] pveum: Add information about realm certificates Dominic Jäger
2020-10-22 16:57   ` [pve-devel] applied: " Thomas Lamprecht
2020-10-22 16:53 ` [pve-devel] applied: [PATCH manager] ui: Fix #2827: Add verify SSL cert checkbox for ldap 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