mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-10 22:37:12 +00:00
Reworked password change logic and add AD support
This commit is contained in:
1 parent
65603201f7
commit
d7e6648396
1 file changed
+19
-6
@@ -632,7 +632,25 @@ static Class NSStringK;
|
||||
IDField, [login escapedForLDAPDN], baseDN];
|
||||
if (userDN)
|
||||
{
|
||||
if (!passwordPolicy)
|
||||
if ([bindConnection isADCompatible])
|
||||
{
|
||||
if ([bindConnection bindWithMethod: @"simple"
|
||||
binddn: userDN
|
||||
credentials: oldPassword])
|
||||
{
|
||||
didChange = [bindConnection changeADPasswordAtDn: userDN
|
||||
oldPassword: oldPassword
|
||||
newPassword: newPassword];
|
||||
}
|
||||
}
|
||||
else if (passwordPolicy)
|
||||
{
|
||||
didChange = [bindConnection changePasswordAtDn: userDN
|
||||
oldPassword: oldPassword
|
||||
newPassword: newPassword
|
||||
perr: (void *)perr];
|
||||
}
|
||||
else
|
||||
{
|
||||
// We don't use a password policy - we simply use
|
||||
// a modify-op to change the password
|
||||
@@ -668,11 +686,6 @@ static Class NSStringK;
|
||||
didChange = NO;
|
||||
}
|
||||
}
|
||||
else
|
||||
didChange = [bindConnection changePasswordAtDn: userDN
|
||||
oldPassword: oldPassword
|
||||
newPassword: newPassword
|
||||
perr: (void *)perr];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user