From 5a8f310bc80b2e2daed248d7e7fb4a400a6ee48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Amor=20Garc=C3=ADa?= Date: Mon, 18 May 2015 14:43:11 +0200 Subject: [PATCH] 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. --- SoObjects/SOGo/LDAPSource.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SoObjects/SOGo/LDAPSource.m b/SoObjects/SOGo/LDAPSource.m index 598e56ffe..1d2d55f5f 100644 --- a/SoObjects/SOGo/LDAPSource.m +++ b/SoObjects/SOGo/LDAPSource.m @@ -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 ;