From 14b60cd75639fc3d23cf59f50d19d060c0a96c0e Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 18 Nov 2019 11:06:15 -0500 Subject: [PATCH] fix(calendar(js)): avoid call to /members when expansion is disabled Expose SOGoLDAPGroupExpansionEnabled in /jsonDefaults to avoid a call to /members when the parameter is disabled. --- UI/PreferencesUI/UIxJSONPreferences.m | 4 ++++ UI/WebServerResources/js/Scheduler/Attendees.service.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m index cc157e5946..e255d61b5c 100644 --- a/UI/PreferencesUI/UIxJSONPreferences.m +++ b/UI/PreferencesUI/UIxJSONPreferences.m @@ -365,6 +365,10 @@ - (NSString *) jsonDefaults [values setObject: [NSNumber numberWithBool: [domainDefaults appointmentSendEMailNotifications]] forKey: @"SOGoAppointmentSendEMailNotifications"]; + // Expose the SOGoLDAPGroupExpansionEnabled configuration parameter from the domain defaults + [values setObject: [NSNumber numberWithBool: [domainDefaults ldapGroupExpansionEnabled]] + forKey: @"SOGoLDAPGroupExpansionEnabled"]; + // Add locale code (used by CK Editor) [values setObject: [locale objectForKey: @"NSLocaleCode"] forKey: @"LocaleCode"]; [values setObject: [NSDictionary dictionaryWithObjectsAndKeys: diff --git a/UI/WebServerResources/js/Scheduler/Attendees.service.js b/UI/WebServerResources/js/Scheduler/Attendees.service.js index 816fa00c37..f068482844 100644 --- a/UI/WebServerResources/js/Scheduler/Attendees.service.js +++ b/UI/WebServerResources/js/Scheduler/Attendees.service.js @@ -182,7 +182,7 @@ if (!_.find(this.attendees, function(o) { return o.email == attendee.email; })) { - if (card.$isList()) { + if (card.$isList() && Attendees.$Preferences.defaults.SOGoLDAPGroupExpansionEnabled) { // LDAP list -- preload members card.$members().then(function(members) { attendee.members = members;