case SEARCHANDBIND:
{
bindAdmin(conn, ldap_admin_dn, ldap_admin_passwd);
Dn baseDn = new Dn(config.getProperty(CONFIGKEY_LDAP_SEARCH_BASE, ""));
String searchQ = String.format(config.getProperty(CONFIGKEY_LDAP_SEARCH_QUERY, "%s"), user);
SearchScope scope = SearchScope.valueOf(config.getProperty(CONFIGKEY_LDAP_SEARCH_SCOPE, SearchScope.ONELEVEL.name()));
EntryCursor cursor = conn.search(baseDn, searchQ, scope, "*");
while (cursor.next()) {
if (userDn != null) {
log.error("more than 1 user found in LDAP");
throw new OmException(-1L);