GUACAMOLE-320: Ensure blank values for the new text attributes of users and connections are properly interpreted.

This commit is contained in:
Michael Jumper
2017-06-27 16:06:47 -07:00
parent ed066c88e7
commit f7e648787e
2 changed files with 6 additions and 6 deletions

View File

@@ -285,8 +285,8 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
logger.debug("Unable to parse numeric attribute.", e);
}
// Set guacd hostname (no translation necessary)
getModel().setProxyHostname(attributes.get(GUACD_HOSTNAME_NAME));
// Translate guacd hostname
getModel().setProxyHostname(TextField.parse(attributes.get(GUACD_HOSTNAME_NAME)));
// Translate guacd port
try { getModel().setProxyPort(NumericField.parse(attributes.get(GUACD_PORT_NAME))); }

View File

@@ -526,16 +526,16 @@ public class ModeledUser extends ModeledDirectoryObject<UserModel> implements Us
private void setUnrestrictedAttributes(Map<String, String> attributes) {
// Translate full name attribute
getModel().setFullName(attributes.get(User.Attribute.FULL_NAME));
getModel().setFullName(TextField.parse(attributes.get(User.Attribute.FULL_NAME)));
// Translate email address attribute
getModel().setEmailAddress(attributes.get(User.Attribute.EMAIL_ADDRESS));
getModel().setEmailAddress(TextField.parse(attributes.get(User.Attribute.EMAIL_ADDRESS)));
// Translate organization attribute
getModel().setOrganization(attributes.get(User.Attribute.ORGANIZATION));
getModel().setOrganization(TextField.parse(attributes.get(User.Attribute.ORGANIZATION)));
// Translate role attribute
getModel().setOrganizationalRole(attributes.get(User.Attribute.ORGANIZATIONAL_ROLE));
getModel().setOrganizationalRole(TextField.parse(attributes.get(User.Attribute.ORGANIZATIONAL_ROLE)));
}