]> source.dussan.org Git - gitblit.git/commitdiff
Allow LDAP to reset/delete an user email address value 34/134/1
authorJames Moger <james.moger@gitblit.com>
Mon, 8 Sep 2014 17:57:09 +0000 (13:57 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 8 Sep 2014 17:57:09 +0000 (13:57 -0400)
src/main/java/com/gitblit/auth/LdapAuthProvider.java

index a4d7bb0536f40a5df9baeb021973302a70007631..5690073a99ef6c40fe13b92f8cc6e4e3db396cad 100644 (file)
@@ -427,6 +427,10 @@ public class LdapAuthProvider extends UsernamePasswordAuthenticationProvider {
                                Attribute attribute = userEntry.getAttribute(email);
                                if (attribute != null && attribute.hasValue()) {
                                        user.emailAddress = attribute.getValue();
+                               } else {
+                                       // issue-456/ticket-134
+                                       // allow LDAP to delete an email address
+                                       user.emailAddress = null;
                                }
                        }
                }