James Moger
2014-04-08 a27e682a6414459ea065147d5de354ceff056535
Merged #41 "Warn on LDAP synchronization if the uid attribute is null/undefined"
2 files modified
9 ■■■■ changed files
releases.moxie 1 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/auth/LdapAuthProvider.java 8 ●●●● patch | view | raw | blame | history
releases.moxie
@@ -16,6 +16,7 @@
    - Ensure the Lucene ticket index is updated on repository deletion.
    changes:
    - Specify the --dailyLogFile option for the Ubuntu and CentOS service scripts (issue-348)
    - Improve logging for missing LDAP uid attribute when synchronizing (issue-394)
    - The ticket close-on-push commit message regular expression is now configurable by a setting (issue-404)
    - Redirect to summary page on edit repository (issue-405)
    - Option to allow LDAP users to directly authenticate without performing LDAP searches (pr-162)
src/main/java/com/gitblit/auth/LdapAuthProvider.java
@@ -119,8 +119,12 @@
                        final Map<String, UserModel> ldapUsers = new HashMap<String, UserModel>();
                        for (SearchResultEntry loggingInUser : result.getSearchEntries()) {
                            final String username = loggingInUser.getAttribute(uidAttribute).getValue();
                            Attribute uid = loggingInUser.getAttribute(uidAttribute);
                            if (uid == null) {
                                logger.error("Can not synchronize with LDAP, missing \"{}\" attribute", uidAttribute);
                                continue;
                            }
                            final String username = uid.getValue();
                            logger.debug("LDAP synchronizing: " + username);
                            UserModel user = userManager.getUserModel(username);