mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-20 02:45:25 +00:00
feat(core): Check password strength on login (SQL Source). Closes #6025.
This commit is contained in:
@@ -2306,7 +2306,7 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
|
||||
|
||||
- (NSArray *) membersForGroupWithUID: (NSString *) uid
|
||||
{
|
||||
NSMutableArray *dns, *uids;
|
||||
NSMutableArray *dns, *uids, *userLogins;
|
||||
NSString *dn, *login;
|
||||
SOGoUserManager *um;
|
||||
NSDictionary *d, *contactInfos;
|
||||
@@ -2327,6 +2327,7 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
|
||||
members = [NSMutableArray new];
|
||||
uids = [NSMutableArray array];
|
||||
dns = [NSMutableArray array];
|
||||
userLogins = [NSMutableArray array];
|
||||
|
||||
// We check if it's a static group
|
||||
// Fetch "members" - we get DNs
|
||||
@@ -2358,6 +2359,13 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
|
||||
pool = [NSAutoreleasePool new];
|
||||
dn = [dns objectAtIndex: i];
|
||||
login = [um getLoginForDN: [dn lowercaseString]];
|
||||
if([userLogins containsObject: login])
|
||||
{
|
||||
[pool release];
|
||||
continue; //user alrady fetch
|
||||
}
|
||||
if(login != nil)
|
||||
[userLogins addObject: login];
|
||||
user = [SOGoUser userWithLogin: login roles: nil];
|
||||
if (user)
|
||||
{
|
||||
@@ -2385,6 +2393,13 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
|
||||
{
|
||||
pool = [NSAutoreleasePool new];
|
||||
login = [uids objectAtIndex: i];
|
||||
if([userLogins containsObject: login])
|
||||
{
|
||||
[pool release];
|
||||
continue; //user alrady fetch
|
||||
}
|
||||
if(login != nil)
|
||||
[userLogins addObject: login];
|
||||
user = [SOGoUser userWithLogin: login roles: nil];
|
||||
if (user)
|
||||
{
|
||||
@@ -2456,4 +2471,4 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
|
||||
return rc;
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
@@ -521,7 +521,7 @@ static const NSString *kObfuscatedSecondaryEmailKey = @"obfuscatedSecondaryEmail
|
||||
perr: perr
|
||||
expire: expire
|
||||
grace: grace];
|
||||
if ([sogoSource userPasswordPolicy] && [[sogoSource userPasswordPolicy] count] > 0) {
|
||||
if (_additionalInfo && *_additionalInfo && [sogoSource userPasswordPolicy] && [[sogoSource userPasswordPolicy] count] > 0) {
|
||||
[*_additionalInfo setObject:[sogoSource userPasswordPolicy] forKey:@"userPolicies"];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user