mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Parameters must be passed along to configs servlet. Connection URLs need not contain authentication parameters, as they will already have been passed to the configs servlet. Forward parameters along to login servlet if available.
This commit is contained in:
@@ -102,15 +102,8 @@
|
|||||||
// with the given id.
|
// with the given id.
|
||||||
function getClientURL(id) {
|
function getClientURL(id) {
|
||||||
|
|
||||||
// Get parameters from query string
|
// Construct URL for client with given id
|
||||||
var parameters = window.location.search.substring(1);
|
return "client.xhtml?id=" + encodeURIComponent(id);
|
||||||
|
|
||||||
// Construct URL for client, including any additional
|
|
||||||
// parameters from the query string
|
|
||||||
var client_url = "client.xhtml?id=" + encodeURIComponent(id);
|
|
||||||
if (parameters) client_url += "&" + parameters;
|
|
||||||
|
|
||||||
return client_url;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,9 +114,12 @@
|
|||||||
// authenticated.
|
// authenticated.
|
||||||
function resetUI() {
|
function resetUI() {
|
||||||
|
|
||||||
|
// Get parameters from query string
|
||||||
|
var parameters = window.location.search.substring(1);
|
||||||
|
|
||||||
var configs;
|
var configs;
|
||||||
try {
|
try {
|
||||||
configs = getConfigList();
|
configs = getConfigList(parameters);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|
||||||
@@ -196,6 +192,10 @@
|
|||||||
|
|
||||||
loginForm.onsubmit = function() {
|
loginForm.onsubmit = function() {
|
||||||
|
|
||||||
|
// Get parameters from query string
|
||||||
|
var parameters = window.location.search.substring(1);
|
||||||
|
|
||||||
|
// Get username and password from form
|
||||||
var username = document.getElementById("username");
|
var username = document.getElementById("username");
|
||||||
var password = document.getElementById("password");
|
var password = document.getElementById("password");
|
||||||
|
|
||||||
@@ -203,6 +203,9 @@
|
|||||||
"username=" + encodeURIComponent(username.value)
|
"username=" + encodeURIComponent(username.value)
|
||||||
+ "&password=" + encodeURIComponent(password.value)
|
+ "&password=" + encodeURIComponent(password.value)
|
||||||
|
|
||||||
|
// Include query parameters in submission data
|
||||||
|
if (parameters) data += "&" + parameters;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// Log in
|
// Log in
|
||||||
|
@@ -5,11 +5,15 @@ function Config(protocol, id) {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConfigList() {
|
function getConfigList(parameters) {
|
||||||
|
|
||||||
|
// Construct request URL
|
||||||
|
var configs_url = "configs";
|
||||||
|
if (parameters) configs_url += "?" + parameters;
|
||||||
|
|
||||||
// Get config list
|
// Get config list
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.open("GET", "configs", false);
|
xhr.open("GET", configs_url, false);
|
||||||
xhr.send(null);
|
xhr.send(null);
|
||||||
|
|
||||||
// If fail, throw error
|
// If fail, throw error
|
||||||
|
Reference in New Issue
Block a user