Commit 6405cb34 authored by Jeff Burke's avatar Jeff Burke
Browse files

t72796: check for presence of nsaccountlock when getting users

parent 94e68b6b
...@@ -473,7 +473,9 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO ...@@ -473,7 +473,9 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO
Filter filter = null; Filter filter = null;
try try
{ {
filter = Filter.createEqualityFilter(searchField, userID.getName()); Filter notFilter = Filter.createNOTFilter(Filter.createPresenceFilter(LDAP_NSACCOUNTLOCK));
Filter equalsFilter = Filter.createEqualityFilter(searchField, userID.getName());
filter = Filter.createANDFilter(notFilter, equalsFilter);
logger.debug("search filter: " + filter); logger.debug("search filter: " + filter);
SearchRequest searchRequest = SearchRequest searchRequest =
...@@ -571,7 +573,9 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO ...@@ -571,7 +573,9 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO
Filter filter = null; Filter filter = null;
try try
{ {
filter = Filter.createEqualityFilter("email", emailAddress); Filter notFilter = Filter.createNOTFilter(Filter.createPresenceFilter(LDAP_NSACCOUNTLOCK));
Filter equalsFilter = Filter.createEqualityFilter("email", emailAddress);
filter = Filter.createANDFilter(notFilter, equalsFilter);
logger.debug("search filter: " + filter); logger.debug("search filter: " + filter);
SearchRequest searchRequest = SearchRequest searchRequest =
...@@ -683,7 +687,9 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO ...@@ -683,7 +687,9 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO
try try
{ {
Filter filter = Filter.createEqualityFilter(searchField, userID.getName()); Filter notFilter = Filter.createNOTFilter(Filter.createPresenceFilter(LDAP_NSACCOUNTLOCK));
Filter equalsFilter = Filter.createEqualityFilter(searchField, userID.getName());
Filter filter = Filter.createANDFilter(notFilter, equalsFilter);
profiler.checkpoint("getAugmentedUser.createFilter"); profiler.checkpoint("getAugmentedUser.createFilter");
logger.debug("search filter: " + filter); logger.debug("search filter: " + filter);
...@@ -792,7 +798,9 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO ...@@ -792,7 +798,9 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO
{ {
final Collection<User<Principal>> users = new ArrayList<User<Principal>>(); final Collection<User<Principal>> users = new ArrayList<User<Principal>>();
Filter filter = Filter.createPresenceFilter(LDAP_UID); Filter notFilter = Filter.createNOTFilter(Filter.createPresenceFilter(LDAP_NSACCOUNTLOCK));
Filter presenceFilter = Filter.createPresenceFilter(LDAP_UID);
Filter filter = Filter.createANDFilter(notFilter, presenceFilter);
logger.debug("search filter: " + filter); logger.debug("search filter: " + filter);
final String[] attributes = new String[] final String[] attributes = new String[]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment