Show 'complexity password' error instead of a generic error.

There is not discrimination between complexity and length errors because backend does not
return different error codes for each case.
pull/83/head
Javier Amor García 2015-05-18 14:43:11 +02:00
parent b7907d654d
commit 5a8f310bc8
1 changed files with 8 additions and 1 deletions

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 ;