GUAC-1388: Correct whitespace errors. Remove unrelated reformatting.

This commit is contained in:
Michael Jumper
2016-01-22 08:28:02 -08:00
parent a9b8fce84d
commit 84eb4d8598
3 changed files with 20 additions and 19 deletions

View File

@@ -88,7 +88,7 @@ guacamole.properties such that the authentication provider is available.
# The base DN within which all guacConfig objects can be found. # The base DN within which all guacConfig objects can be found.
ldap-config-base-dn: dc=example,dc=net ldap-config-base-dn: dc=example,dc=net
# The base DN within which all role based groups can be found. # The base DN within which all role based groups can be found.
ldap-group-base-dn: ou=groups,dc=example,dc=net ldap-group-base-dn: ou=groups,dc=example,dc=net

View File

@@ -62,10 +62,10 @@ public class LDAPGuacamoleProperties {
public String getName() { return "ldap-user-base-dn"; } public String getName() { return "ldap-user-base-dn"; }
}; };
/** /**
* The base DN of role based access control (RBAC) groups. * The base DN of role based access control (RBAC) groups. All groups
* All groups should be under this DN. * should be under this DN.
*/ */
public static final StringGuacamoleProperty LDAP_GROUP_BASE_DN = new StringGuacamoleProperty() { public static final StringGuacamoleProperty LDAP_GROUP_BASE_DN = new StringGuacamoleProperty() {

View File

@@ -96,9 +96,8 @@ public class ConnectionService {
// Do not return any connections if base DN is not specified // Do not return any connections if base DN is not specified
String configurationBaseDN = confService.getConfigurationBaseDN(); String configurationBaseDN = confService.getConfigurationBaseDN();
if (configurationBaseDN == null) { if (configurationBaseDN == null)
return Collections.<String, Connection>emptyMap(); return Collections.<String, Connection>emptyMap();
}
try { try {
@@ -112,7 +111,7 @@ public class ConnectionService {
// Get the search filter for finding connections associated to the userDN // Get the search filter for finding connections associated to the userDN
String connectionSearchFilter = getConnectionSearchFilter(userDN, ldapConnection); String connectionSearchFilter = getConnectionSearchFilter(userDN, ldapConnection);
// Find all Guacamole connections for the given user by // Find all Guacamole connections for the given user by
// looking for direct membership in the guacConfigGroup // looking for direct membership in the guacConfigGroup
// and possibly any groups the user is a member of that are // and possibly any groups the user is a member of that are
@@ -195,12 +194,13 @@ public class ConnectionService {
// Return map of all connections // Return map of all connections
return connections; return connections;
} catch (LDAPException e) { }
catch (LDAPException e) {
throw new GuacamoleServerException("Error while querying for connections.", e); throw new GuacamoleServerException("Error while querying for connections.", e);
} }
} }
/** /**
* Returns the connection search filter for the given userDN. * Returns the connection search filter for the given userDN.
* *
@@ -215,12 +215,14 @@ public class ConnectionService {
* *
* @throws LDAPException * @throws LDAPException
* If an error occurs preventing retrieval of user groups. * If an error occurs preventing retrieval of user groups.
* *
* @throws GuacamoleException * @throws GuacamoleException
* If an error occurs retrieving the group base DN. * If an error occurs retrieving the group base DN.
*/ */
private String getConnectionSearchFilter(String userDN, LDAPConnection ldapConnection) throws LDAPException, GuacamoleException { private String getConnectionSearchFilter(String userDN,
LDAPConnection ldapConnection)
throws LDAPException, GuacamoleException {
// Create a search filter for the connection search // Create a search filter for the connection search
StringBuilder connectionSearchFilter = new StringBuilder(); StringBuilder connectionSearchFilter = new StringBuilder();
@@ -231,7 +233,6 @@ public class ConnectionService {
// If group base DN is specified search for user groups // If group base DN is specified search for user groups
String groupBaseDN = confService.getGroupBaseDN(); String groupBaseDN = confService.getGroupBaseDN();
if (groupBaseDN != null) { if (groupBaseDN != null) {
// Get all groups the user is a member of starting at the groupBaseDN, excluding guacConfigGroups // Get all groups the user is a member of starting at the groupBaseDN, excluding guacConfigGroups
@@ -244,19 +245,19 @@ public class ConnectionService {
); );
// Append the additional user groups to the LDAP filter // Append the additional user groups to the LDAP filter
// Now the filter will also look for guacConfigGroups that refer // Now the filter will also look for guacConfigGroups that refer
// to groups the user is a member of // to groups the user is a member of
// The guacConfig group uses the seeAlso attribute to refer // The guacConfig group uses the seeAlso attribute to refer
// to these other groups // to these other groups
while (userRoleGroupResults.hasMore()) { while (userRoleGroupResults.hasMore()) {
LDAPEntry entry = userRoleGroupResults.next(); LDAPEntry entry = userRoleGroupResults.next();
connectionSearchFilter.append("(seeAlso=").append(escapingService.escapeLDAPSearchFilter(entry.getDN())).append(")"); connectionSearchFilter.append("(seeAlso=").append(escapingService.escapeLDAPSearchFilter(entry.getDN())).append(")");
} }
} }
// Complete the search filter. // Complete the search filter.
connectionSearchFilter.append("))"); connectionSearchFilter.append("))");
return connectionSearchFilter.toString(); return connectionSearchFilter.toString();
} }