[pmg-devel] [PATCH pmg-gui 2/3] add verify certificate checkbox for ldap

Dominik Csapak d.csapak at proxmox.com
Wed Mar 13 15:17:11 CET 2019


that defaults to on, this way we have a new default on the gui without
breaking existing installations

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 js/LDAPConfig.js | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/js/LDAPConfig.js b/js/LDAPConfig.js
index 79f23f8..f4f6a20 100644
--- a/js/LDAPConfig.js
+++ b/js/LDAPConfig.js
@@ -59,7 +59,22 @@ Ext.define('PMG.LDAPInputPanel', {
 		    ['ldaps', PMG.Utils.format_ldap_protocol('ldaps')]
 		],
 		value: 'ldap',
-		fieldLabel: gettext('Protocol')
+		fieldLabel: gettext('Protocol'),
+		listeners: {
+		    change: function(cb, value) {
+			var isldap = (value === 'ldap');
+			me.down('field[name=verify]').setVisible(!isldap);
+		    }
+		}
+	    },
+	    {
+		xtype: 'proxmoxcheckbox',
+		name: 'verify',
+		fieldLabel: gettext('Verify Certificate'),
+		hidden: true,
+		uncheckedValue: 0,
+		value: 1,
+		checked: 1
 	    },
 	    {
 		xtype: 'textfield',
@@ -205,6 +220,7 @@ Ext.define('PMG.LDAPEdit', {
 		    var values = response.result.data;
 
 		    values.enable = values.disable ? 0 : 1;
+		    values.verify = !!values.verify;
 		    ipanel.setValues(values);
 		}
 	    });
-- 
2.11.0




More information about the pmg-devel mailing list