Skip to content

Commit

Permalink
point readme to the latest release always, enable some debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry de Graaff committed Jul 3, 2019
1 parent 4f0f3d7 commit d39fa3b
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 28 deletions.
154 changes: 129 additions & 25 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ You can get any ldaps ssl certificate by using OpenSSL: openssl s_client -connec
Review your LDAP configuration in the commands below and then copy-paste them:

mkdir -p /opt/zimbra/lib/ext/adpassword
wget https://github.com/Zimbra-Community/ADPassword/releases/download/0.0.4/ADPassword.jar -O /opt/zimbra/lib/ext/adpassword/adPassword.jar
wget https://github.com/Zimbra-Community/ADPassword/raw/master/out/artifacts/ADPassword_jar/ADPassword.jar -O /opt/zimbra/lib/ext/adpassword/adPassword.jar
su zimbra
zmprov md domain.ext zimbraAuthLdapBindDn "%[email protected]"
zmprov md domain.ext zimbraAuthLdapSearchBase "CN=Users,DC=DOMAIN,DC=EXT"
Expand Down
Binary file modified out/artifacts/ADPassword_jar/ADPassword.jar
Binary file not shown.
Binary file not shown.
9 changes: 7 additions & 2 deletions src/it/iknowconsulting/adpassword/ADConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ public void updatePassword(Account acct, String password) throws NamingException
}
else
{
ldapContext.modifyAttributes(fetchUser(username), mods);
System.out.print("ADPassword->ADConnection->updatePassword->username: "+ username);
System.out.print("ADPassword->ADConnection->updatePassword->fetchUser(username): "+ fetchUser(username));
System.out.print("ADPassword->ADConnection->updatePassword->mods: "+ mods);
ldapContext.modifyAttributes(fetchUser(username), mods);
}
}

Expand All @@ -91,9 +94,11 @@ String fetchUser(String username) throws NamingException {
searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
searchControls.setReturningAttributes(returnedAttrs);
String searchFilter = authLdapSearchFilter.replace("%u",username);
System.out.print("ADPassword->ADConnection->fetchUser->searchFilter: "+ searchFilter);
NamingEnumeration results = ldapContext.search(authLdapSearchBase, searchFilter, searchControls);

SearchResult sr = (SearchResult) results.next();
SearchResult sr = (SearchResult) results.next();
System.out.print("ADPassword->ADConnection->fetchUser->getNameInNamespace: "+ sr.getNameInNamespace());
return sr.getNameInNamespace();
}
}

0 comments on commit d39fa3b

Please sign in to comment.