public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Dominic Jäger" <d.jaeger@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: Fix #2827: Add verify SSL cert checkbox for ldap
Date: Thu, 15 Oct 2020 12:00:18 +0200	[thread overview]
Message-ID: <20201015100019.311138-1-d.jaeger@proxmox.com> (raw)

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




             reply	other threads:[~2020-10-15 10:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 10:00 Dominic Jäger [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201015100019.311138-1-d.jaeger@proxmox.com \
    --to=d.jaeger@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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