summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-06-25 19:38:54 +0200
committerArthur Schiwon <blizzz@owncloud.com>2014-08-29 11:14:36 +0200
commit371cab367d2b786c0fadb3a76daeb3ba9138e164 (patch)
tree6079217db38894d2581d84a8e3c49ff918e041a4 /apps/user_ldap/js
parent6958033db9f6bd2ff7e69b05a6cb064206957a65 (diff)
downloadnextcloud-server-371cab367d2b786c0fadb3a76daeb3ba9138e164.tar.gz
nextcloud-server-371cab367d2b786c0fadb3a76daeb3ba9138e164.zip
trigger email detection by Wizard upon any user filter filter change. before it happenend only upon user automatic list filter creation, but not on manual editing
Diffstat (limited to 'apps/user_ldap/js')
-rw-r--r--apps/user_ldap/js/ldapFilter.js5
-rw-r--r--apps/user_ldap/js/settings.js18
2 files changed, 19 insertions, 4 deletions
diff --git a/apps/user_ldap/js/ldapFilter.js b/apps/user_ldap/js/ldapFilter.js
index df3bd67aec2..e9f60e7ba3c 100644
--- a/apps/user_ldap/js/ldapFilter.js
+++ b/apps/user_ldap/js/ldapFilter.js
@@ -14,7 +14,7 @@ function LdapFilter(target) {
}
}
-LdapFilter.prototype.compose = function() {
+LdapFilter.prototype.compose = function(callback) {
var action;
if(this.locked) {
@@ -50,6 +50,9 @@ LdapFilter.prototype.compose = function() {
LdapWizard.countGroups();
LdapWizard.detectGroupMemberAssoc();
}
+ if(typeof callback !== 'undefined') {
+ callback();
+ }
},
function () {
console.log('LDAP Wizard: could not compose filter. '+
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index 87d755697cb..fd84ca1980b 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -340,6 +340,14 @@ var LdapWizard = {
LdapWizard._countThings('countUsers');
},
+ detectEmailAttribute: function() {
+ param = 'action=detectEmailAttribute'+
+ '&ldap_serverconfig_chooser='+
+ encodeURIComponent($('#ldap_serverconfig_chooser').val());
+ //runs in the background, no callbacks necessary
+ LdapWizard.ajax(param, LdapWizard.applyChanges, function(){});
+ },
+
detectGroupMemberAssoc: function() {
param = 'action=determineGroupMemberAssoc'+
'&ldap_serverconfig_chooser='+
@@ -577,7 +585,7 @@ var LdapWizard = {
postInitUserFilter: function() {
if(LdapWizard.userFilterObjectClassesHasRun &&
LdapWizard.userFilterAvailableGroupsHasRun) {
- LdapWizard.userFilter.compose();
+ LdapWizard.userFilter.compose(LdapWizard.detectEmailAttribute);
LdapWizard.countUsers();
}
},
@@ -619,6 +627,7 @@ var LdapWizard = {
if(triggerObj.id == 'ldap_userlist_filter') {
LdapWizard.countUsers();
+ LdapWizard.detectEmailAttribute();
} else if(triggerObj.id == 'ldap_group_filter') {
LdapWizard.countGroups();
LdapWizard.detectGroupMemberAssoc();
@@ -656,9 +665,12 @@ var LdapWizard = {
LdapWizard._save($('#'+originalObj)[0], $.trim(values));
if(originalObj == 'ldap_userfilter_objectclass'
|| originalObj == 'ldap_userfilter_groups') {
- LdapWizard.userFilter.compose();
+ LdapWizard.userFilter.compose(LdapWizard.detectEmailAttribute);
//when user filter is changed afterwards, login filter needs to
//be adjusted, too
+ if(!LdapWizard.loginFilter) {
+ LdapWizard.initLoginFilter();
+ }
LdapWizard.loginFilter.compose();
} else if(originalObj == 'ldap_loginfilter_attributes') {
LdapWizard.loginFilter.compose();
@@ -720,7 +732,7 @@ var LdapWizard = {
LdapWizard._save({ id: modeKey }, LdapWizard.filterModeAssisted);
if(moc.indexOf('user') >= 0) {
LdapWizard.blacklistRemove('ldap_userlist_filter');
- LdapWizard.userFilter.compose();
+ LdapWizard.userFilter.compose(LdapWizard.detectEmailAttribute);
} else {
LdapWizard.blacklistRemove('ldap_group_filter');
LdapWizard.groupFilter.compose();