From b7b44eb8af21e7cd5adb16648ee8f9d70a8d8f6e Mon Sep 17 00:00:00 2001 From: "ingo.wiarda" Date: Fri, 4 May 2018 09:36:53 +0200 Subject: [PATCH] Rename ldapGroup to externalGroup, since the login connector may be used for other login types. --- ldap-config.example.xml | 2 +- src/java/cinnamon/authentication/LdapConfig.java | 12 ++++++------ .../authentication/UnboundIdLdapConnector.java | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ldap-config.example.xml b/ldap-config.example.xml index 0ea7bb0..680efc8 100644 --- a/ldap-config.example.xml +++ b/ldap-config.example.xml @@ -7,7 +7,7 @@ member - authors + authors group.authors diff --git a/src/java/cinnamon/authentication/LdapConfig.java b/src/java/cinnamon/authentication/LdapConfig.java index ac5c21c..4751dc5 100644 --- a/src/java/cinnamon/authentication/LdapConfig.java +++ b/src/java/cinnamon/authentication/LdapConfig.java @@ -31,7 +31,7 @@ public class LdapConfig { * Example: * cn=Users,dc=cinnamon,dc=dewarim,dc=coom * - * The query will be pre-pended with cn=$ldapGroup from groupMappings. + * The query will be pre-pended with cn=$externalGroup from groupMappings. * Example: * cn=retrieval-users,cn=Users,dc=localhost */ @@ -111,15 +111,15 @@ public void setGroupMappings(List groupMappings) { public static class GroupMapping { - private String ldapGroup; + private String externalGroup; private String cinnamonGroup; - public String getLdapGroup() { - return ldapGroup; + public String getExternalGroup() { + return externalGroup; } - public void setLdapGroup(String ldapGroup) { - this.ldapGroup = ldapGroup; + public void setExternalGroup(String externalGroup) { + this.externalGroup = externalGroup; } public String getCinnamonGroup() { diff --git a/src/java/cinnamon/authentication/UnboundIdLdapConnector.java b/src/java/cinnamon/authentication/UnboundIdLdapConnector.java index 04fb5c7..9fcaa56 100644 --- a/src/java/cinnamon/authentication/UnboundIdLdapConnector.java +++ b/src/java/cinnamon/authentication/UnboundIdLdapConnector.java @@ -52,7 +52,7 @@ public LdapResult connect(String username, String password) { log.debug("connection: " + conn); final LDAPConnection connection = conn; List groupMappings = ldapConfig.getGroupMappings().stream() - .filter(groupMapping -> searchForGroup(connection, groupMapping.getLdapGroup(), username)) + .filter(groupMapping -> searchForGroup(connection, groupMapping.getExternalGroup(), username)) .collect(Collectors.toList()); return new LdapResult(!groupMappings.isEmpty(), groupMappings);