mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +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;
|
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() {
|
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
|
* Creates a new BasicFileAuthenticationProvider that authenticates users
|
||||||
* against simple, monolithic XML file.
|
* against simple, monolithic XML file.
|
||||||
@@ -110,9 +116,10 @@ public class BasicFileAuthenticationProvider extends SimpleAuthenticationProvide
|
|||||||
*/
|
*/
|
||||||
private UserMapping getUserMapping() throws GuacamoleException {
|
private UserMapping getUserMapping() throws GuacamoleException {
|
||||||
|
|
||||||
// Get user user_mapping file
|
// Get user mapping file, defaulting to GUACAMOLE_HOME/user-mapping.xml
|
||||||
File user_mapping_file =
|
File user_mapping_file = environment.getProperty(BASIC_USER_MAPPING);
|
||||||
environment.getRequiredProperty(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 not yet read, or user_mapping has been modified, reread
|
||||||
if (user_mapping == null ||
|
if (user_mapping == null ||
|
||||||
|
Reference in New Issue
Block a user