Skip to content

Commit

Permalink
Group lookup correction; pulled version to 1.0.2
Browse files Browse the repository at this point in the history
Signed-off-by: dwimberger <dieter@wimpi.net>
  • Loading branch information
dwimberger committed Aug 4, 2013
1 parent db3430f commit 02411e6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.wimpi.crowd.ldap</groupId>
<artifactId>crowd-ldap-server</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.2-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Crowd-LDAP-Server</name>
Expand Down
2 changes: 1 addition & 1 deletion run.sh
@@ -1,5 +1,5 @@
#!/bin/sh
JAR=target/crowd-ldap-server-1.0-SNAPSHOT.jar
JAR=target/crowd-ldap-server-1.0.2-SNAPSHOT.jar

# Apache DS Settings
FIXADS="-Duser.language=en -Duser.country=US"
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/net/wimpi/crowd/ldap/CrowdPartition.java
Expand Up @@ -264,12 +264,18 @@ public boolean hasEntry(EntryOperationContext ctx) throws UserNotFoundException,
log.error("hasEntry()", ex);
}
log.debug("Prefix=" + prefix);
if (isCrowdGroups(prefix) || isCrowdUsers(prefix)) {
if (isCrowdUsers(prefix)) {
RDN rdn = dn.getRdn(2);
String user = rdn.getNormValue();
log.debug("user=" + user);
ServerEntry userEntry = createUserEntry(dn);
return (userEntry != null);
} else if(isCrowdGroups(prefix)) {
RDN rdn = dn.getRdn(2);
String group = rdn.getNormValue();
log.debug("group=" + group);
ServerEntry groupEntry = createGroupEntry(dn);
return (groupEntry != null);
} else {
log.debug("Prefix is neither users nor groups");
log.debug("Crowd Users = " + m_CrowdUsersEntry.getDn());
Expand Down
4 changes: 3 additions & 1 deletion testAuth.sh
@@ -1,3 +1,5 @@
#!/bin/bash
USER_UID=<Crowd user>
USER_UID=$1
GROUP_ID=$2
ldapsearch -v -x -D 'uid='${USER_UID}',ou=users,dc=crowd' -W -H ldap://localhost:10389 -b ou=users,dc=crowd uid=${USER_UID}
ldapsearch -WxD "uid=${USER_UID},ou=users,dc=crowd" -H ldap://localhost:10389 -b "dn=${GROUP_ID},ou=groups,dc=crowd"

0 comments on commit 02411e6

Please sign in to comment.