userFilter: false,
loginFilter: false,
groupFilter: false,
+ ajaxRequests: {},
- ajax: function(param, fnOnSuccess, fnOnError) {
- $.post(
+ ajax: function(param, fnOnSuccess, fnOnError, reqID) {
+ if(reqID !== undefined) {
+ if(LdapWizard.ajaxRequests.hasOwnProperty(reqID)) {
+ LdapWizard.ajaxRequests[reqID].abort();
+ }
+ }
+ var request = $.post(
OC.filePath('user_ldap','ajax','wizard.php'),
param,
function(result) {
}
}
);
+ if(reqID !== undefined) {
+ LdapWizard.ajaxRequests[reqID] = request;
+ }
},
applyChanges: function (result) {
LdapWizard.showInfoBox(t('user_ldap', 'Please specify a Base DN'));
LdapWizard.showInfoBox(t('user_ldap', 'Could not determine Base DN'));
$('#ldap_base').prop('disabled', false);
- }
+ },
+ 'guessBaseDN'
);
}
},
LdapWizard.hideSpinner('#ldap_port');
$('#ldap_port').prop('disabled', false);
LdapWizard.showInfoBox(t('user_ldap', 'Please specify the port'));
- }
+ },
+ 'guessPortAndTLS'
);
}
},
encodeURIComponent($('#ldap_serverconfig_chooser').val());
LdapWizard.showSpinner(spinnerID);
- LdapWizard.ajax(param,
+ var request = LdapWizard.ajax(param,
function(result) {
LdapWizard.applyChanges(result);
LdapWizard.hideSpinner(spinnerID);
function (result) {
OC.Notification.show('Counting the entries failed with, ' + result.message);
LdapWizard.hideSpinner(spinnerID);
- }
+ },
+ method
);
},
'&ldap_serverconfig_chooser='+
encodeURIComponent($('#ldap_serverconfig_chooser').val());
//runs in the background, no callbacks necessary
- LdapWizard.ajax(param, LdapWizard.applyChanges, function(){});
+ LdapWizard.ajax(param, LdapWizard.applyChanges, function(){}, 'detectEmailAttribute');
},
detectGroupMemberAssoc: function() {
},
function (result) {
// error handling
- }
+ },
+ 'determineGroupMemberAssoc'
);
},
{noneSelectedText : 'No attributes found'});
$('#ldap_loginfilter_attributes').multiselect('disable');
LdapWizard.hideSpinner('#ldap_loginfilter_attributes');
- }
+ },
+ 'determineAttributes'
);
},
findAvailableGroups: function(multisel, type) {
- if(type != 'Users' && type != 'Groups') {
+ if(type !== 'Users' && type !== 'Groups') {
return false;
}
param = 'action=determineGroupsFor'+encodeURIComponent(type)+
LdapWizard.userFilterAvailableGroupsHasRun = true;
LdapWizard.postInitUserFilter();
}
- }
+ },
+ 'findAvailableGroupsFor' + type
);
},
LdapWizard.postInitUserFilter();
}
//TODO: error handling
- }
+ },
+ 'determine' + type + 'ObjectClasses'
);
},