mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-587: Default to GUACAMOLE_HOME/user-mapping.xml.
This commit is contained in:
@@ -76,7 +76,7 @@ public class BasicFileAuthenticationProvider extends SimpleAuthenticationProvide
|
||||
private final Environment environment;
|
||||
|
||||
/**
|
||||
* The filename of the XML file to read the user user_mapping from.
|
||||
* The XML file to read the user mapping from.
|
||||
*/
|
||||
public static final FileGuacamoleProperty BASIC_USER_MAPPING = new FileGuacamoleProperty() {
|
||||
|
||||
@@ -85,6 +85,12 @@ public class BasicFileAuthenticationProvider extends SimpleAuthenticationProvide
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* The default filename to use for the user mapping, if not defined within
|
||||
* guacamole.properties.
|
||||
*/
|
||||
public static final String DEFAULT_USER_MAPPING = "user-mapping.xml";
|
||||
|
||||
/**
|
||||
* Creates a new BasicFileAuthenticationProvider that authenticates users
|
||||
* against simple, monolithic XML file.
|
||||
@@ -110,9 +116,10 @@ public class BasicFileAuthenticationProvider extends SimpleAuthenticationProvide
|
||||
*/
|
||||
private UserMapping getUserMapping() throws GuacamoleException {
|
||||
|
||||
// Get user user_mapping file
|
||||
File user_mapping_file =
|
||||
environment.getRequiredProperty(BASIC_USER_MAPPING);
|
||||
// Get user mapping file, defaulting to GUACAMOLE_HOME/user-mapping.xml
|
||||
File user_mapping_file = environment.getProperty(BASIC_USER_MAPPING);
|
||||
if (user_mapping_file == null)
|
||||
user_mapping_file = new File(environment.getGuacamoleHome(), DEFAULT_USER_MAPPING);
|
||||
|
||||
// If user_mapping not yet read, or user_mapping has been modified, reread
|
||||
if (user_mapping == null ||
|
||||
|
Reference in New Issue
Block a user