mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-593: Add documentation to new methods, properly escape attribute.
This commit is contained in:
@@ -359,6 +359,17 @@ public class ConfigurationService {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the LDAP attribute used to enumerate
|
||||
* members in a group, or "member" by default.
|
||||
*
|
||||
* @return
|
||||
* The name of the LDAP attribute to use to enumerate
|
||||
* members in a group.
|
||||
*
|
||||
* @throws GuacamoleException
|
||||
* If guacamole.properties connect be parsed.
|
||||
*/
|
||||
public String getMemberAttribute() throws GuacamoleException {
|
||||
return environment.getProperty(
|
||||
LDAPGuacamoleProperties.LDAP_MEMBER_ATTRIBUTE,
|
||||
|
@@ -216,6 +216,9 @@ public class LDAPGuacamoleProperties {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* LDAP attribute used to enumerate members of a group in the LDAP directory.
|
||||
*/
|
||||
public static final StringGuacamoleProperty LDAP_MEMBER_ATTRIBUTE = new StringGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
|
@@ -247,7 +247,8 @@ public class ConnectionService {
|
||||
// Add the prefix to the search filter, prefix filter searches for guacConfigGroups with the userDN as the member attribute value
|
||||
connectionSearchFilter.append("(&(objectClass=guacConfigGroup)");
|
||||
connectionSearchFilter.append("(|(");
|
||||
connectionSearchFilter.append(confService.getMemberAttribute());
|
||||
connectionSearchFilter.append(escapingService.escapeLDAPSearchFilter(
|
||||
confService.getMemberAttribute()));
|
||||
connectionSearchFilter.append("=");
|
||||
connectionSearchFilter.append(escapingService.escapeLDAPSearchFilter(userDN));
|
||||
connectionSearchFilter.append(")");
|
||||
@@ -261,7 +262,8 @@ public class ConnectionService {
|
||||
groupBaseDN,
|
||||
LDAPConnection.SCOPE_SUB,
|
||||
"(&(!(objectClass=guacConfigGroup))("
|
||||
+ confService.getMemberAttribute()
|
||||
+ escapingService.escapeLDAPSearchFilter(
|
||||
confService.getMemberAttribute())
|
||||
+ "=" + escapingService.escapeLDAPSearchFilter(userDN)
|
||||
+ "))",
|
||||
null,
|
||||
|
Reference in New Issue
Block a user