From 60c53021df660563d0be52b307f8dbbcbbbca22c Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Tue, 27 Oct 2020 18:56:19 +0100 Subject: fix language tags for Guacamole 1.2.0, workaround for greyed out continue button, add build logging Build revision and timestamp are logged on start and sent as http request headers on connection to the sat server. (Bwlp-Plugin-Build-Revision and Bwlp-Plugin-Build-Timestamp) This build now requires guacamole >=1.2.0 --- .../java/de/bwlehrpool/bwlp_guac/ConnectionManager.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java') diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java index db8ff07..1f7d928 100644 --- a/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java +++ b/src/main/java/de/bwlehrpool/bwlp_guac/ConnectionManager.java @@ -30,7 +30,8 @@ import javax.net.ssl.X509TrustManager; import org.apache.guacamole.form.Field; import org.apache.guacamole.net.auth.credentials.CredentialsInfo; import org.apache.guacamole.net.auth.credentials.GuacamoleCredentialsException; -import org.apache.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException; +import org.apache.guacamole.language.TranslatableGuacamoleCredentialsException; +import org.apache.guacamole.language.TranslatableGuacamoleInsufficientCredentialsException; import org.codehaus.jackson.map.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -135,8 +136,8 @@ public class ConnectionManager { JsonGroup group = groupPool.get(groupid); if (group == null) { // Request the user to select a group - throw new GuacamoleInsufficientCredentialsException( - "GROUP_SELECTION.TITLE", new CredentialsInfo( + throw new TranslatableGuacamoleInsufficientCredentialsException( + "GROUP_SELECTION.TITLE", "GROUP_SELECTION.TITLE", new CredentialsInfo( Collections.singletonList(new GroupField()) )); } @@ -164,8 +165,8 @@ public class ConnectionManager { } if (freeClient == null) { // Request the user to select another Group - throw new GuacamoleCredentialsException( - "GROUP_SELECTION.NO_FREE_ERROR", new CredentialsInfo( + throw new TranslatableGuacamoleCredentialsException( + "GROUP_SELECTION.NO_FREE_ERROR", "GROUP_SELECTION.NO_FREE_ERROR", new CredentialsInfo( Collections.singletonList(new GroupField()) )); } @@ -217,6 +218,8 @@ public class ConnectionManager { ((HttpsURLConnection) con).setHostnameVerifier(ignorer); ((HttpsURLConnection) con).setSSLSocketFactory(sockFac); } + con.setRequestProperty("Bwlp-Plugin-Build-Revision", BwlpAuthenticationProvider.MANIFEST.getProperty("Build-Revision")); + con.setRequestProperty("Bwlp-Plugin-Build-Timestamp", BwlpAuthenticationProvider.MANIFEST.getProperty("Build-Revision-Timestamp")); try (BufferedInputStream in = new BufferedInputStream(con.getInputStream())) { byte dataBuffer[] = new byte[2048]; int bytesRead; -- cgit v1.2.3-55-g7522