mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-1239: Remove per-extension configuration for case-sensitivity, retaining only global configuration.
This commit is contained in:
@@ -21,6 +21,11 @@ package org.apache.guacamole.net.auth;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.guacamole.environment.Environment;
|
||||
import org.apache.guacamole.environment.LocalEnvironment;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Basic implementation of an AuthenticatedUser which uses the username to
|
||||
@@ -29,6 +34,17 @@ import java.util.Set;
|
||||
public abstract class AbstractAuthenticatedUser extends AbstractIdentifiable
|
||||
implements AuthenticatedUser {
|
||||
|
||||
/**
|
||||
* The logger for this class.
|
||||
*/
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractAuthenticatedUser.class);
|
||||
|
||||
/**
|
||||
* The server environment in which this Guacamole Client instance is
|
||||
* running.
|
||||
*/
|
||||
private final Environment environment = LocalEnvironment.getInstance();
|
||||
|
||||
// Prior functionality now resides within AbstractIdentifiable
|
||||
|
||||
@Override
|
||||
@@ -36,6 +52,21 @@ public abstract class AbstractAuthenticatedUser extends AbstractIdentifiable
|
||||
return Collections.<String>emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCaseSensitive() {
|
||||
try {
|
||||
return environment.getCaseSensitiveUsernames();
|
||||
}
|
||||
catch (GuacamoleException e) {
|
||||
LOGGER.warn("Exception attempting to read the Guacamole configuration, "
|
||||
+ "usernames will be treated as case-sensitive.", e.getMessage());
|
||||
LOGGER.debug("Received GuacamoleException attempting to retrieve the "
|
||||
+ "case-sensitivity setting for usernames. Defaulting to"
|
||||
+ "case-sensitive usernames.", e);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
// Nothing to invalidate
|
||||
|
@@ -83,6 +83,11 @@ public class DelegatingUser implements User {
|
||||
return user.isDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCaseSensitive() {
|
||||
return user.isCaseSensitive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
user.setDisabled(disabled);
|
||||
|
Reference in New Issue
Block a user