GUACAMOLE-101: Remove connection search filter changes.

This commit is contained in:
Nick Couchman
2017-03-28 07:50:08 -04:00
parent 5c768384bc
commit db9876e736
3 changed files with 2 additions and 34 deletions

View File

@@ -292,24 +292,4 @@ public class ConfigurationService {
);
}
/**
* Returns the search filter that should be used when querying the
* LDAP server for Guacamole connections. If no filter is specified,
* the default of objectClass=guacConfigGroup is returned.
*
* @return
* The search filter that should be used when querying the
* LDAP server for connections for Guacamole, or
* objectClass=guacConfigGroup if no filter is specified.
*
* @throws GuacamoleException
* If guacamole.properties cannot be parsed.
*/
public String getConnectionSearchFilter() throws GuacamoleException {
return environment.getProperty(
LDAPGuacamoleProperties.LDAP_CONNECTION_SEARCH_FILTER,
"(objectClass=guacConfigGroup)"
);
}
}

View File

@@ -174,14 +174,4 @@ public class LDAPGuacamoleProperties {
};
/**
* A search filter to apply to connection LDAP queries.
*/
public static final StringGuacamoleProperty LDAP_CONNECTION_SEARCH_FILTER = new StringGuacamoleProperty() {
@Override
public String getName() { return "ldap-connection-search-filter"; }
};
}

View File

@@ -227,9 +227,7 @@ public class ConnectionService {
StringBuilder connectionSearchFilter = new StringBuilder();
// Add the prefix to the search filter, prefix filter searches for guacConfigGroups with the userDN as the member attribute value
connectionSearchFilter.append("(&");
connectionSearchFilter.append(confService.getConnectionSearchFilter());
connectionSearchFilter.append("(|(member=");
connectionSearchFilter.append("(&(objectClass=guacConfigGroup)(|(member=");
connectionSearchFilter.append(escapingService.escapeLDAPSearchFilter(userDN));
connectionSearchFilter.append(")");
@@ -241,7 +239,7 @@ public class ConnectionService {
LDAPSearchResults userRoleGroupResults = ldapConnection.search(
groupBaseDN,
LDAPConnection.SCOPE_SUB,
"(&(!" + confService.getConnectionSearchFilter() + ")(member=" + escapingService.escapeLDAPSearchFilter(userDN) + "))",
"(&(!(objectClass=guacConfigGroup))(member=" + escapingService.escapeLDAPSearchFilter(userDN) + "))",
null,
false,
confService.getLDAPSearchConstraints()