Merge pull request #137 from Zentyal/jag/change-passsword-exceptions

Return appropiate error code when changing AD password with incorrect…
This commit is contained in:
Jesús García Sáez
2015-05-23 02:23:02 +02:00

View File

@@ -737,7 +737,15 @@ groupObjectClasses: (NSArray *) newGroupObjectClasses
}
NS_HANDLER
{
[self logWithFormat: @"%@", localException];
if ([[localException name] isEqual: @"LDAPException"] &&
([[[localException userInfo] objectForKey: @"error_code"] intValue] == LDAP_CONSTRAINT_VIOLATION))
{
*perr = PolicyInsufficientPasswordQuality;
}
else
{
[self logWithFormat: @"%@", localException];
}
}
NS_ENDHANDLER ;