summaryrefslogtreecommitdiffstats
path: root/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java')
-rw-r--r--src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java
index 0fc7bc8..c59c477 100644
--- a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java
+++ b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java
@@ -66,26 +66,26 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider {
if (user != null && user.hasValidConnection())
return user;
- int locationid = requestLocation(credentials);
+ int groupid = requestGroup(credentials);
LOGGER.warn("Doing the REdecoration");
- user = new BwlpUserContext(authenticatedUser, context, locationid);
+ user = new BwlpUserContext(authenticatedUser, context, groupid);
oldMappings.put(username, user);
return user;
}
- private int requestLocation(Credentials credentials) throws GuacamoleException {
- // Request the user to select a location
+ private int requestGroup(Credentials credentials) throws GuacamoleException {
+ // Request the user to select a group
ConnectionManager.updateList();
HttpServletRequest request = credentials.getRequest();
- String locationJson = request.getParameter("location");
+ String groupJson = request.getParameter("group");
- if (locationJson == null) {
+ if (groupJson == null) {
throw new GuacamoleInsufficientCredentialsException(
"Select Location", new CredentialsInfo(
- Collections.<Field>singletonList(new LocationField())
+ Collections.<Field>singletonList(new GroupField())
));
}
@@ -98,14 +98,14 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider {
String password = "";
String correctPassword = null;
try {
- JsonNode location = mapper.readTree(locationJson);
- selectedId = Integer.parseInt(location.get("id").asText());
+ JsonNode group = mapper.readTree(groupJson);
+ selectedId = Integer.parseInt(group.get("id").asText());
if (selectedId != 0) {
- password = location.get("password").asText();
- correctPassword = ConnectionManager.getLocationPool().get(selectedId).password;
+ password = group.get("password").asText();
+ correctPassword = ConnectionManager.getGroupPool().get(selectedId).password;
}
} catch (Exception e) {
- LOGGER.info("Error reading location", e);
+ LOGGER.info("Error reading group", e);
tryAgain = true;
}
@@ -117,7 +117,7 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider {
if (tryAgain) {
throw new GuacamoleCredentialsException(
message, new CredentialsInfo(
- Collections.<Field>singletonList(new LocationField())
+ Collections.<Field>singletonList(new GroupField())
));
}