parent
1641235163
commit
25021c192c
|
@ -1173,6 +1173,12 @@ for operations is also bounded by the maximum time that the server is
|
|||
configured to allow.
|
||||
|
||||
Defaults to `0` (unlimited).
|
||||
|
||||
|D |SOGoLDAPGroupExpansionEnabled
|
||||
|Parameter used to enable group expansion from the Web interface.
|
||||
|
||||
Defaults to `NO` when unset.
|
||||
|
||||
|=======================================================================
|
||||
|
||||
LDAP Attributes Indexing
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
|
||||
NSString *_domain;
|
||||
NSString *_contactInfoAttribute;
|
||||
BOOL _groupExpansionEnabled;
|
||||
|
||||
NSDictionary *_contactMapping;
|
||||
NSArray *_contactObjectClasses;
|
||||
|
@ -125,6 +126,8 @@ andMultipleBookingsField: (NSString *) newMultipleBookingsField;
|
|||
|
||||
- (void) updateBaseDNFromLogin: (NSString *) theLogin;
|
||||
|
||||
- (BOOL) groupExpansionEnabled;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* LDAPSOURCE_H */
|
||||
|
|
|
@ -165,7 +165,7 @@ static Class NSStringK;
|
|||
inDomain: (NSString *) sourceDomain
|
||||
{
|
||||
SOGoDomainDefaults *dd;
|
||||
NSNumber *udQueryLimit, *udQueryTimeout, *dotValue;
|
||||
NSNumber *udQueryLimit, *udQueryTimeout, *udGroupExpansionEnabled, *dotValue;
|
||||
|
||||
if ((self = [self init]))
|
||||
{
|
||||
|
@ -238,6 +238,14 @@ static Class NSStringK;
|
|||
else
|
||||
_queryTimeout = [dd ldapQueryTimeout];
|
||||
|
||||
if ([[udSource allKeys] containsObject: @"SOGoLDAPGroupExpansionEnabled"])
|
||||
{
|
||||
udGroupExpansionEnabled = [udSource objectForKey: @"SOGoLDAPGroupExpansionEnabled"];
|
||||
_groupExpansionEnabled = [udGroupExpansionEnabled boolValue];
|
||||
}
|
||||
else
|
||||
_groupExpansionEnabled = [dd ldapGroupExpansionEnabled];
|
||||
|
||||
ASSIGN(_modulesConstraints, [udSource objectForKey: @"ModulesConstraints"]);
|
||||
ASSIGN(_filter, [udSource objectForKey: @"filter"]);
|
||||
ASSIGN(_userPasswordAlgorithm, [udSource objectForKey: @"userPasswordAlgorithm"]);
|
||||
|
@ -1461,6 +1469,11 @@ groupObjectClasses: (NSArray *) newGroupObjectClasses
|
|||
return _groupObjectClasses;
|
||||
}
|
||||
|
||||
- (BOOL) groupExpansionEnabled
|
||||
{
|
||||
return _groupExpansionEnabled;
|
||||
}
|
||||
|
||||
static NSArray *
|
||||
_convertRecordToLDAPAttributes (LDAPSourceSchema *schema, NSDictionary *ldifRecord)
|
||||
{
|
||||
|
|
|
@ -75,6 +75,8 @@
|
|||
- (NSArray *) freeBusyDefaultInterval;
|
||||
- (int) davCalendarStartTimeLimit;
|
||||
|
||||
- (BOOL) ldapGroupExpansionEnabled;
|
||||
|
||||
- (BOOL) iPhoneForceAllDayTransparency;
|
||||
|
||||
- (NSArray *) additionalJSFiles;
|
||||
|
|
|
@ -314,6 +314,11 @@
|
|||
return [self stringForKey: @"SOGoLDAPContactInfoAttribute"];
|
||||
}
|
||||
|
||||
- (BOOL) ldapGroupExpansionEnabled
|
||||
{
|
||||
return [self boolForKey: @"SOGoLDAPGroupExpansionEnabled"];
|
||||
}
|
||||
|
||||
- (NSArray *) freeBusyDefaultInterval
|
||||
{
|
||||
return [self arrayForKey: @"SOGoFreeBusyDefaultInterval"];
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
#import <SOGo/NSArray+Utilities.h>
|
||||
#import <SOGo/NSCalendarDate+SOGo.h>
|
||||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
#import <SOGo/LDAPSource.h>
|
||||
#import <SOGo/SOGoGroup.h>
|
||||
#import <SOGo/SOGoSource.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/SOGoUserManager.h>
|
||||
|
@ -395,42 +397,58 @@
|
|||
NSMutableDictionary *userData;
|
||||
NSString *email;
|
||||
SOGoObject <SOGoContactObject> *contact;
|
||||
SOGoObject <SOGoSource> *source;
|
||||
SOGoUser *user;
|
||||
id <WOActionResults> result;
|
||||
unsigned int i, max;
|
||||
|
||||
result = nil;
|
||||
contact = [self clientObject];
|
||||
source = [[contact container] source];
|
||||
dict = [[SOGoUserManager sharedUserManager] contactInfosForUserWithUIDorEmail: [contact nameInContainer]];
|
||||
|
||||
if ([[dict objectForKey: @"isGroup"] boolValue])
|
||||
{
|
||||
SOGoGroup *aGroup;
|
||||
|
||||
aGroup = [SOGoGroup groupWithIdentifier: [contact nameInContainer]
|
||||
inDomain: [[context activeUser] domain]];
|
||||
allUsers = [aGroup members]; // array of SOGoUser objects
|
||||
max = [allUsers count];
|
||||
allUsersData = [NSMutableArray arrayWithCapacity: max];
|
||||
for (i = 0; i < max; i++)
|
||||
if ([source isKindOfClass: [LDAPSource class]] && [(LDAPSource *) source groupExpansionEnabled])
|
||||
{
|
||||
user = [allUsers objectAtIndex: i];
|
||||
allUserEmails = [NSMutableArray array];
|
||||
emails = [[user allEmails] objectEnumerator];
|
||||
while ((email = [emails nextObject])) {
|
||||
[allUserEmails addObject: [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
email, @"value", @"work", @"type", nil]];
|
||||
}
|
||||
userData = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[user loginInDomain], @"c_uid",
|
||||
[user cn], @"c_cn",
|
||||
allUserEmails, @"emails", nil];
|
||||
[allUsersData addObject: userData];
|
||||
SOGoGroup *aGroup;
|
||||
|
||||
aGroup = [SOGoGroup groupWithIdentifier: [contact nameInContainer]
|
||||
inDomain: [[context activeUser] domain]];
|
||||
allUsers = [aGroup members]; // array of SOGoUser objects
|
||||
max = [allUsers count];
|
||||
allUsersData = [NSMutableArray arrayWithCapacity: max];
|
||||
for (i = 0; i < max; i++)
|
||||
{
|
||||
user = [allUsers objectAtIndex: i];
|
||||
allUserEmails = [NSMutableArray array];
|
||||
emails = [[user allEmails] objectEnumerator];
|
||||
while ((email = [emails nextObject])) {
|
||||
[allUserEmails addObject: [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
email, @"value", @"work", @"type", nil]];
|
||||
}
|
||||
userData = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[user loginInDomain], @"c_uid",
|
||||
[user cn], @"c_cn",
|
||||
allUserEmails, @"emails", nil];
|
||||
[allUsersData addObject: userData];
|
||||
}
|
||||
dict = [NSDictionary dictionaryWithObject: allUsersData forKey: @"members"];
|
||||
result = [self responseWithStatus: 200
|
||||
andString: [dict jsonRepresentation]];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = [self responseWithStatus: 403
|
||||
andString: @"Group is not expandable"];
|
||||
}
|
||||
dict = [NSDictionary dictionaryWithObject: allUsersData forKey: @"members"];
|
||||
result = [self responseWithStatus: 200
|
||||
andString: [dict jsonRepresentation]];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = [self responseWithStatus: 405
|
||||
andString: @"Contact is not a group"];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
<div class="sg-md-subhead"><div>{{currentAttendee.name}}</div></div>
|
||||
<div class="sg-md-body">
|
||||
<div>{{currentAttendee.email}}</div>
|
||||
<md-button class="sg-tile-thread" md-colors="::{ color: 'accent-600'}" ng-if="currentAttendee.isGroup" ng-click="editor.expandAttendee(currentAttendee)">
|
||||
<md-button class="sg-tile-thread" md-colors="::{ color: 'accent-600'}" ng-if="currentAttendee.isExpandableGroup" ng-click="editor.expandAttendee(currentAttendee)">
|
||||
<md-icon class="md-rotate-180-ccw" md-colors="::{ color: 'accent-600'}">add_box</md-icon><span ng-bind="currentAttendee.members.length"></span>
|
||||
</md-button>
|
||||
</div>
|
||||
|
|
|
@ -171,6 +171,7 @@
|
|||
domain: card.c_domain,
|
||||
isMSExchange: card.ismsexchange,
|
||||
isGroup: card.$isList(),
|
||||
isExpandableGroup: false,
|
||||
isResource: card.isresource,
|
||||
name: card.c_cn,
|
||||
email: card.$$email,
|
||||
|
@ -185,6 +186,7 @@
|
|||
// LDAP list -- preload members
|
||||
card.$members().then(function(members) {
|
||||
attendee.members = members;
|
||||
attendee.isExpandableGroup = true;
|
||||
});
|
||||
}
|
||||
attendee.image = Attendees.$gravatar(attendee.email, 32);
|
||||
|
|
Loading…
Reference in New Issue