Skip to content

Commit

Permalink
Rename ldapGroup to externalGroup, since the login connector may be u…
Browse files Browse the repository at this point in the history
…sed for other login types.
  • Loading branch information
dewarim committed May 4, 2018
1 parent 0cd1572 commit b7b44eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ldap-config.example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<searchAttribute>member</searchAttribute>
<groupMappings>
<groupMapping>
<ldapGroup>authors</ldapGroup>
<externalGroup>authors</externalGroup>
<cinnamonGroup>group.authors</cinnamonGroup>
</groupMapping>
</groupMappings>
Expand Down
12 changes: 6 additions & 6 deletions src/java/cinnamon/authentication/LdapConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -111,15 +111,15 @@ public void setGroupMappings(List<GroupMapping> 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public LdapResult connect(String username, String password) {
log.debug("connection: " + conn);
final LDAPConnection connection = conn;
List<LdapConfig.GroupMapping> 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);
Expand Down

0 comments on commit b7b44eb

Please sign in to comment.