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

Return appropiate error code when changing AD password with incorrect…
This commit is contained in:
extrafu
2015-05-21 08:42:17 -04:00
+8 -1
View File
@@ -737,7 +737,14 @@ 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 ;