mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-300: conform to guac-style style guidelines
https://guacamole.apache.org/guac-style/
This commit is contained in:
@@ -384,7 +384,8 @@ public class ConfigurationService {
|
||||
* @throws GuacamoleException
|
||||
* If guacamole.properties cannot be parsed.
|
||||
*/
|
||||
public MemberAttributeType getMemberAttributeType() throws GuacamoleException {
|
||||
public MemberAttributeType getMemberAttributeType()
|
||||
throws GuacamoleException {
|
||||
return environment.getProperty(
|
||||
LDAPGuacamoleProperties.LDAP_MEMBER_ATTRIBUTE_TYPE,
|
||||
MemberAttributeType.DN
|
||||
|
@@ -259,7 +259,8 @@ public class LDAPGuacamoleProperties {
|
||||
/**
|
||||
* Specify the type of data contained in 'ldap-member-attribute'
|
||||
*/
|
||||
public static final MemberAttributeTypeProperty LDAP_MEMBER_ATTRIBUTE_TYPE = new MemberAttributeTypeProperty() {
|
||||
public static final MemberAttributeTypeProperty LDAP_MEMBER_ATTRIBUTE_TYPE =
|
||||
new MemberAttributeTypeProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "ldap-member-attribute-type"; }
|
||||
|
@@ -20,7 +20,8 @@
|
||||
package org.apache.guacamole.auth.ldap.conf;
|
||||
|
||||
/**
|
||||
* All possible means of describing membership within LDAP group directory records.
|
||||
* All possible means of describing membership within
|
||||
* LDAP group directory records.
|
||||
*/
|
||||
public enum MemberAttributeType {
|
||||
/**
|
||||
|
@@ -28,10 +28,12 @@ import org.apache.guacamole.properties.GuacamoleProperty;
|
||||
* strings "dn" or "uid" are mapped to their values as a MemberAttributeType
|
||||
* enum. Anything else results in a parse error.
|
||||
*/
|
||||
public abstract class MemberAttributeTypeProperty implements GuacamoleProperty<MemberAttributeType> {
|
||||
public abstract class MemberAttributeTypeProperty
|
||||
implements GuacamoleProperty<MemberAttributeType> {
|
||||
|
||||
@Override
|
||||
public MemberAttributeType parseValue(String value) throws GuacamoleException {
|
||||
public MemberAttributeType parseValue(String value)
|
||||
throws GuacamoleException {
|
||||
|
||||
// If no value provided, return null.
|
||||
if (value == null)
|
||||
@@ -46,7 +48,8 @@ public abstract class MemberAttributeTypeProperty implements GuacamoleProperty<M
|
||||
return MemberAttributeType.UID;
|
||||
|
||||
// The provided value is not legal
|
||||
throw new GuacamoleServerException("Member attribute type must be one of \"dn\" or \"uid\".");
|
||||
throw new GuacamoleServerException("Member attribute type must be "
|
||||
+ "one of \"dn\" or \"uid\".");
|
||||
|
||||
}
|
||||
|
||||
|
@@ -188,19 +188,22 @@ public class UserGroupService {
|
||||
confService.getUserSearchFilter(),
|
||||
0);
|
||||
// ... there can surely only be one
|
||||
if (userEntries.size() != 1) {
|
||||
logger.warn("user DN \"{}\" does not return unique value and will be ignored",
|
||||
userDN.toString());
|
||||
} else {
|
||||
if (userEntries.size() != 1)
|
||||
logger.warn("user DN \"{}\" does not return unique value "
|
||||
+ "and will be ignored", userDN.toString());
|
||||
else {
|
||||
// determine unique identifier for user
|
||||
Entry userEntry = userEntries.get(0);
|
||||
Collection<String> userAttributes = confService.getUsernameAttributes();
|
||||
try {
|
||||
userIDorDN = queryService.getIdentifier(userEntry, userAttributes);
|
||||
userIDorDN = queryService.getIdentifier(userEntry,
|
||||
userAttributes);
|
||||
}
|
||||
catch (LdapInvalidAttributeValueException e) {
|
||||
logger.error("User group missing identifier: {}", e.getMessage());
|
||||
logger.debug("LDAP exception while getting group identifier.", e);
|
||||
logger.error("User group missing identifier: {}",
|
||||
e.getMessage());
|
||||
logger.debug("LDAP exception while getting "
|
||||
+ "group identifier.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user