See ChangeLog
Monotone-Parent: 9663f3f262f24910bf38ccb82e6718016ca35645 Monotone-Revision: 4c2f6d4f42eaf2a0ba7489c4099bcdf881808c53 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-04-06T12:54:03 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
f3eb9161de
commit
62cdc5a13c
|
@ -1,3 +1,11 @@
|
|||
* Improved the sogod-wrapper script in order to
|
||||
consider the IP address that can be specified
|
||||
in the WOPort user default. Patch from
|
||||
Romain LE DISEZ <romain.ledisez@netensia.fr>
|
||||
* SoObjects/SOGo/LDAPSource.{h.m}: Now possible to
|
||||
specify a scope for LDAP operations. Patch from
|
||||
Yann Cezard <yann.cezard@univ-pau.fr>
|
||||
|
||||
2009-04-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/LDAPSource.m: we now support an "encryption"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# SOGo daemon wrapper
|
||||
#
|
||||
# Copyright (C) 2007 Inverse inc.
|
||||
# Copyright (C) 2007-2009 Inverse inc.
|
||||
#
|
||||
# Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
#
|
||||
|
@ -55,10 +55,10 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
startport=`defaults read sogod WOPort`
|
||||
woport=`defaults read sogod WOPort`
|
||||
if [ "$?" == "0" ]
|
||||
then
|
||||
startport=`echo $startport | awk '{print $3}'`
|
||||
startport=`echo $woport | awk '{print $3}' | sed -e 's/\(.*:\)//'`
|
||||
else
|
||||
startport=20000
|
||||
fi
|
||||
|
@ -69,8 +69,9 @@ then
|
|||
else
|
||||
let "port=$startport + $1 - 1"
|
||||
fi
|
||||
listen=`echo $woport | awk '{ print $3 }' | sed -e 's/\([0-9]\+\)$/'$port'/g'`
|
||||
|
||||
# echo "SOGOD: $sogod" 2>&1
|
||||
|
||||
exec $sogod -WOPort $port >> /var/log/sogo/sogod-$port.log 2>&1 &
|
||||
exec $sogod -WOPort $listen >> /var/log/sogo/sogod-$port.log 2>&1 &
|
||||
echo $! > $PIDFILE
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
NSString *password;
|
||||
NSString *encryption;
|
||||
NSString *_filter;
|
||||
NSString *_scope;
|
||||
|
||||
NSString *baseDN;
|
||||
NSString *IDField; /* the first part of a user DN */
|
||||
|
|
|
@ -167,6 +167,7 @@ static NSLock *lock;
|
|||
mailFields = [NSArray arrayWithObject: @"mail"];
|
||||
[mailFields retain];
|
||||
bindFields = nil;
|
||||
_scope = @"sub";
|
||||
_filter = nil;
|
||||
|
||||
ldapConnection = nil;
|
||||
|
@ -192,6 +193,7 @@ static NSLock *lock;
|
|||
[ldapConnection release];
|
||||
[sourceID release];
|
||||
[modulesConstraints release];
|
||||
[_scope release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -199,7 +201,7 @@ static NSLock *lock;
|
|||
{
|
||||
self = [self init];
|
||||
|
||||
ASSIGN (sourceID, [udSource objectForKey: @"id"]);
|
||||
ASSIGN(sourceID, [udSource objectForKey: @"id"]);
|
||||
|
||||
[self setBindDN: [udSource objectForKey: @"bindDN"]
|
||||
password: [udSource objectForKey: @"bindPassword"]
|
||||
|
@ -212,9 +214,10 @@ static NSLock *lock;
|
|||
UIDField: [udSource objectForKey: @"UIDFieldName"]
|
||||
mailFields: [udSource objectForKey: @"MailFieldNames"]
|
||||
andBindFields: [udSource objectForKey: @"bindFields"]];
|
||||
ASSIGN (modulesConstraints, [udSource objectForKey: @"ModulesConstraints"]);
|
||||
ASSIGN (_filter, [udSource objectForKey: @"filter"]);
|
||||
|
||||
ASSIGN(modulesConstraints, [udSource objectForKey: @"ModulesConstraints"]);
|
||||
ASSIGN(_filter, [udSource objectForKey: @"filter"]);
|
||||
ASSIGN(_scope, ([udSource objectForKey: @"scope"] ? (id)[udSource objectForKey: @"scope"]: (id)@"sub"));
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -334,10 +337,31 @@ static NSLock *lock;
|
|||
|
||||
if ([self _initLDAPConnection])
|
||||
{
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier:
|
||||
[self _qualifierForBindFilter: loginToCheck]
|
||||
attributes: [NSArray arrayWithObject: @"dn"]];
|
||||
EOQualifier *qualifier;
|
||||
NSArray *attributes;
|
||||
|
||||
qualifier = [self _qualifierForBindFilter: loginToCheck];
|
||||
attributes = [NSArray arrayWithObject: @"dn"];
|
||||
|
||||
if ([_scope caseInsensitiveCompare: @"BASE"] == NSOrderedSame)
|
||||
{
|
||||
entries = [ldapConnection baseSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
}
|
||||
else if ([_scope caseInsensitiveCompare: @"ONE"] == NSOrderedSame)
|
||||
{
|
||||
entries = [ldapConnection flatSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
}
|
||||
else /* else we do like it was before */
|
||||
{
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
}
|
||||
|
||||
userEntry = [entries nextObject];
|
||||
}
|
||||
else
|
||||
|
@ -507,9 +531,23 @@ static NSLock *lock;
|
|||
ids = [NSMutableArray array];
|
||||
|
||||
if ([self _initLDAPConnection])
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: nil
|
||||
attributes: [NSArray arrayWithObject: IDField]];
|
||||
{
|
||||
NSArray *attributes;
|
||||
|
||||
attributes = [NSArray arrayWithObject: IDField];
|
||||
if ([_scope caseInsensitiveCompare: @"BASE"] == NSOrderedSame)
|
||||
entries = [ldapConnection baseSearchAtBaseDN: baseDN
|
||||
qualifier: nil
|
||||
attributes: attributes];
|
||||
else if ([_scope caseInsensitiveCompare: @"ONE"] == NSOrderedSame)
|
||||
entries = [ldapConnection flatSearchAtBaseDN: baseDN
|
||||
qualifier: nil
|
||||
attributes: attributes];
|
||||
else /* else we do like it was before */
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: nil
|
||||
attributes: attributes];
|
||||
}
|
||||
else
|
||||
entries = nil;
|
||||
|
||||
|
@ -638,9 +676,26 @@ static NSLock *lock;
|
|||
if ([match length] > 0)
|
||||
{
|
||||
if ([self _initLDAPConnection])
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: [self _qualifierForFilter: match]
|
||||
attributes: [self _searchAttributes]];
|
||||
{
|
||||
EOQualifier *qualifier;
|
||||
NSArray *attributes;
|
||||
|
||||
qualifier = [self _qualifierForFilter: match];
|
||||
attributes = [self _searchAttributes];
|
||||
|
||||
if ([_scope caseInsensitiveCompare: @"BASE"] == NSOrderedSame)
|
||||
entries = [ldapConnection baseSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
else if ([_scope caseInsensitiveCompare: @"ONE"] == NSOrderedSame)
|
||||
entries = [ldapConnection flatSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
else /* else we de like it was before */
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
}
|
||||
else
|
||||
entries = nil;
|
||||
|
||||
|
@ -698,7 +753,6 @@ static NSLock *lock;
|
|||
NSDictionary *contactEntry;
|
||||
NGLdapEntry *ldapEntry;
|
||||
NSEnumerator *entries;
|
||||
EOQualifier *qualifier;
|
||||
|
||||
#if defined(THREADSAFE)
|
||||
[lock lock];
|
||||
|
@ -710,10 +764,25 @@ static NSLock *lock;
|
|||
{
|
||||
if ([self _initLDAPConnection])
|
||||
{
|
||||
EOQualifier *qualifier;
|
||||
NSArray *attributes;
|
||||
|
||||
qualifier = [self _qualifierForUIDFilter: uid];
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: [self _searchAttributes]];
|
||||
attributes = [self _searchAttributes];
|
||||
|
||||
if ([_scope caseInsensitiveCompare: @"BASE"] == NSOrderedSame)
|
||||
entries = [ldapConnection baseSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
else if ([_scope caseInsensitiveCompare: @"ONE"] == NSOrderedSame)
|
||||
entries = [ldapConnection flatSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
else /* else we do like it was before */
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: attributes];
|
||||
|
||||
ldapEntry = [entries nextObject];
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue