mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17: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 {
|
public String getMemberAttribute() throws GuacamoleException {
|
||||||
return environment.getProperty(
|
return environment.getProperty(
|
||||||
LDAPGuacamoleProperties.LDAP_MEMBER_ATTRIBUTE,
|
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() {
|
public static final StringGuacamoleProperty LDAP_MEMBER_ATTRIBUTE = new StringGuacamoleProperty() {
|
||||||
|
|
||||||
@Override
|
@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
|
// 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("(&(objectClass=guacConfigGroup)");
|
||||||
connectionSearchFilter.append("(|(");
|
connectionSearchFilter.append("(|(");
|
||||||
connectionSearchFilter.append(confService.getMemberAttribute());
|
connectionSearchFilter.append(escapingService.escapeLDAPSearchFilter(
|
||||||
|
confService.getMemberAttribute()));
|
||||||
connectionSearchFilter.append("=");
|
connectionSearchFilter.append("=");
|
||||||
connectionSearchFilter.append(escapingService.escapeLDAPSearchFilter(userDN));
|
connectionSearchFilter.append(escapingService.escapeLDAPSearchFilter(userDN));
|
||||||
connectionSearchFilter.append(")");
|
connectionSearchFilter.append(")");
|
||||||
@@ -261,7 +262,8 @@ public class ConnectionService {
|
|||||||
groupBaseDN,
|
groupBaseDN,
|
||||||
LDAPConnection.SCOPE_SUB,
|
LDAPConnection.SCOPE_SUB,
|
||||||
"(&(!(objectClass=guacConfigGroup))("
|
"(&(!(objectClass=guacConfigGroup))("
|
||||||
+ confService.getMemberAttribute()
|
+ escapingService.escapeLDAPSearchFilter(
|
||||||
|
confService.getMemberAttribute())
|
||||||
+ "=" + escapingService.escapeLDAPSearchFilter(userDN)
|
+ "=" + escapingService.escapeLDAPSearchFilter(userDN)
|
||||||
+ "))",
|
+ "))",
|
||||||
null,
|
null,
|
||||||
|
Reference in New Issue
Block a user