Skip to content

Commit

Permalink
(feat) baseDN now accept dynamic domain values (fixes #3685)
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed Feb 4, 2019
1 parent ceaa122 commit d9943e5
Show file tree
Hide file tree
Showing 4 changed files with 369 additions and 354 deletions.
6 changes: 5 additions & 1 deletion Documentation/SOGoInstallationGuide.asciidoc
Expand Up @@ -972,7 +972,11 @@ a replacement for the hostname part in the URI provided by the
_SOGoSieveServer_ parameter.
|baseDN
|The base DN of your user entries.
|The base DN of your user entries. You can use `%d` in this value if you
want the base DN to be built dynamically from the user's domain during
the login process. If you use that, you might always enable bindAsCurrentUser.
For example: `baseDN = "ou=%d,ou=domains,dc=example,dc=com";`
|KindFieldName (optional)
|If set, SOGo will try to determine if the value of the field
Expand Down
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -3,6 +3,7 @@

Enhancements
- [web] create card from sender or recipient address (#3002, #4610)
- [core] baseDN now accept dynamic domain values (#3685)

Bug fixes
- [web] fixed all-day event dates with different timezone
Expand Down
87 changes: 43 additions & 44 deletions SoObjects/SOGo/LDAPSource.h
@@ -1,6 +1,6 @@
/* LDAPSource.h - this file is part of SOGo
*
* Copyright (C) 2007-2015 Inverse inc.
* Copyright (C) 2007-2019 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -21,7 +21,6 @@
#ifndef LDAPSOURCE_H
#define LDAPSOURCE_H


#include "SOGoSource.h"

@class LDAPSourceSchema;
Expand All @@ -33,61 +32,61 @@

@interface LDAPSource : NSObject <SOGoDNSource>
{
int queryLimit;
int queryTimeout;

NSString *sourceID;
NSString *displayName;

NSString *bindDN; // The bindDN/password could be either the source's one
NSString *password; // or the current user if _bindAsCurrentUser is set to YES
NSString *sourceBindDN; // while sourceBindDN/sourceBindPassword always belong to the source
NSString *sourceBindPassword;
NSString *hostname;
unsigned int port;
NSString *encryption;
int _queryLimit;
int _queryTimeout;

NSString *_sourceID;
NSString *_displayName;

NSString *_bindDN; // The bindDN/password could be either the source's one
NSString *_password; // or the current user if _bindAsCurrentUser is set to YES
NSString *_sourceBindDN; // while sourceBindDN/sourceBindPassword always belong to the source
NSString *_sourceBindPassword;
NSString *_hostname;
unsigned int _port;
NSString *_encryption;
NSString *_filter;
BOOL _bindAsCurrentUser;
NSString *_scope;
NSString *_userPasswordAlgorithm;

NSString *baseDN;
LDAPSourceSchema *schema;
NSString *IDField; // the first part of a user DN
NSString *CNField;
NSString *UIDField;
NSArray *mailFields;
NSArray *searchFields;
NSString *IMAPHostField;
NSString *IMAPLoginField;
NSString *SieveHostField;
NSArray *bindFields;
NSString *_baseDN;
LDAPSourceSchema *_schema;
NSString *_IDField; // the first part of a user DN
NSString *_CNField;
NSString *_UIDField;
NSArray *_mailFields;
NSArray *_searchFields;
NSString *_IMAPHostField;
NSString *_IMAPLoginField;
NSString *_SieveHostField;
NSArray *_bindFields;

BOOL listRequiresDot;
BOOL _listRequiresDot;

NSString *domain;
NSString *contactInfoAttribute;
NSString *_domain;
NSString *_contactInfoAttribute;

NSDictionary *contactMapping;
NSArray *contactObjectClasses;
NSArray *groupObjectClasses;
NSDictionary *_contactMapping;
NSArray *_contactObjectClasses;
NSArray *_groupObjectClasses;

NSDictionary *modulesConstraints;
NSDictionary *_modulesConstraints;

BOOL passwordPolicy;
BOOL updateSambaNTLMPasswords;
BOOL _passwordPolicy;
BOOL _updateSambaNTLMPasswords;

/* resources handling */
NSString *kindField;
NSString *multipleBookingsField;
NSString *_kindField;
NSString *_multipleBookingsField;

NSString *MSExchangeHostname;
NSString *_MSExchangeHostname;

/* user addressbooks */
NSString *abOU;
NSString *_abOU;

/* ACL */
NSArray *modifiers;
NSArray *_modifiers;
}

- (void) setBindDN: (NSString *) newBindDN
Expand All @@ -113,13 +112,13 @@ andMultipleBookingsField: (NSString *) newMultipleBookingsField;

/* This enable the convertion of a contact entry with inetOrgPerson and mozillaAbPerson
to and from an LDAP record */
- (void) setContactMapping: (NSDictionary *) newMapping
andObjectClasses: (NSArray *) newObjectClasses;
- (void) setContactMapping: (NSDictionary *) theMapping
andObjectClasses: (NSArray *) theObjectClasses;

- (NGLdapEntry *) lookupGroupEntryByUID: (NSString *) theUID
inDomain: (NSString *) domain;
inDomain: (NSString *) theDomain;
- (NGLdapEntry *) lookupGroupEntryByEmail: (NSString *) theEmail
inDomain: (NSString *) domain;
inDomain: (NSString *) theDomain;

- (void) applyContactMappingToResult: (NSMutableDictionary *) ldifRecord;

Expand Down

0 comments on commit d9943e5

Please sign in to comment.