diff options
Diffstat (limited to 'src/main/java')
3 files changed, 5 insertions, 31 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java b/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java index e9144f8..6126e77 100644 --- a/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java +++ b/src/main/java/de/bwlehrpool/bwlp_guac/AvailableClient.java @@ -143,7 +143,7 @@ public class AvailableClient implements Cloneable { if (now < this.lastConnectionCheck) { this.lastConnectionCheck = 0; } - if (now - this.lastConnectionCheck < 5000) + if (now - this.lastConnectionCheck < 1000) return this.connectionOk; for (;;) { try (VncConnection vnc = new VncConnection(this.clientip, 5900)) { @@ -172,7 +172,7 @@ public class AvailableClient implements Cloneable { return this.connectionOk = false; } } - + @Override public AvailableClient clone() { AvailableClient c = new AvailableClient(this.clientip); diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java index b902621..0fc7bc8 100644 --- a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java +++ b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java @@ -1,21 +1,15 @@ package de.bwlehrpool.bwlp_guac; -import java.io.IOException; import java.util.*; import org.apache.guacamole.GuacamoleException; -import org.apache.guacamole.form.TextField; import org.apache.guacamole.net.auth.*; import org.apache.guacamole.net.auth.credentials.GuacamoleCredentialsException; -import org.apache.guacamole.net.auth.credentials.GuacamoleInvalidCredentialsException; -import org.codehaus.jackson.JsonGenerationException; import org.codehaus.jackson.JsonNode; -import org.codehaus.jackson.map.JsonMappingException; import org.codehaus.jackson.map.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; -import javax.xml.soap.Text; import org.apache.guacamole.form.Field; import org.apache.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException; @@ -34,11 +28,6 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider { } public AuthenticatedUser authenticateUser(Credentials credentials) throws GuacamoleException { - // XXX We can somehow request additional fields to be shown during login by throwing an exception - // that declares additional ones; but when I tried, it removed the existing username and password - // field, so do we need to state them too? Seems wrong since we don't need them, we'd just want - // an additional field to pick the room/location we want to end up in and let the actual - // authentication plugin define the username/password fields. return null; } @@ -60,21 +49,7 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider { public UserContext decorate(UserContext context, AuthenticatedUser authenticatedUser, Credentials credentials) throws GuacamoleException { - String username = authenticatedUser.getCredentials().getUsername(); - - LOGGER.warn("decorate called for " + username); - BwlpUserContext user = oldMappings.get(username); - - if (user != null) - return user; - - int locationid = requestLocation(credentials); - - LOGGER.warn("Doing the decoration"); - user = new BwlpUserContext(authenticatedUser, context, locationid); - oldMappings.put(username, user); - - return user; + return context; } private Map<String, BwlpUserContext> oldMappings = Collections @@ -130,8 +105,7 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider { correctPassword = ConnectionManager.getLocationPool().get(selectedId).password; } } catch (Exception e) { - LOGGER.info("Error reading location"); - LOGGER.info(e.toString()); + LOGGER.info("Error reading location", e); tryAgain = true; } diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpUserContext.java b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpUserContext.java index 05fa78f..ca020f6 100644 --- a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpUserContext.java +++ b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpUserContext.java @@ -9,7 +9,6 @@ import org.apache.guacamole.net.auth.Directory; import org.apache.guacamole.net.auth.User; import org.apache.guacamole.net.auth.UserContext; import org.apache.guacamole.net.auth.credentials.GuacamoleCredentialsException; -import org.apache.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException; import org.apache.guacamole.net.auth.permission.ObjectPermissionSet; import org.apache.guacamole.net.auth.simple.SimpleConnection; import org.apache.guacamole.net.auth.simple.SimpleDirectory; @@ -105,6 +104,7 @@ public class BwlpUserContext extends AbstractUserContext { } catch (Exception e) { LOGGER.warn("hasValidConnection", e); } + if (!ok) connectionDirectory = new SimpleDirectory<Connection>(); return ok; } |