]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - src/window/AuthEditLDAP.js
window: ldap auth edit: set view-model form data explicitly on edit
[proxmox-widget-toolkit.git] / src / window / AuthEditLDAP.js
index aa85c5d1cea6eb4f372ba27de5d18343506cbeaa..cae7c80f547eae7749295c73674782c587d22ba0 100644 (file)
@@ -57,7 +57,9 @@ Ext.define('Proxmox.panel.LDAPInputPanel', {
     },
 
     onSetValues: function(values) {
+       let me = this;
        values.anonymous_search = values["bind-dn"] ? 0 : 1;
+       me.getViewModel().set('anonymous_search', values.anonymous_search);
 
        return values;
     },
@@ -92,7 +94,9 @@ Ext.define('Proxmox.panel.LDAPInputPanel', {
            xtype: 'proxmoxcheckbox',
            fieldLabel: gettext('Anonymous Search'),
            name: 'anonymous_search',
-           bind: '{anonymous_search}',
+           bind: {
+               value: '{anonymous_search}',
+           },
        },
        {
            xtype: 'proxmoxtextfield',
@@ -243,6 +247,11 @@ Ext.define('Proxmox.panel.LDAPSyncInputPanel', {
        Proxmox.Utils.delete_if_default(values, 'sync-defaults-options');
        Proxmox.Utils.delete_if_default(values, 'sync-attributes');
 
+       // Force values.delete to be an array
+       if (typeof values.delete === 'string') {
+          values.delete = values.delete.split(',');
+       }
+
        if (me.isCreate) {
            delete values.delete; // on create we cannot delete values
        }