Add global variable of SELF_CLOSE which can be used to close the window during a logout instead or redirecting the window to another page.
Add the param selfclose=1 to the url to make it work
var tunneltype = getParameter("tunnel");
var wsendpoint = getParameter("wsendpoint", "websocket-tunnel");
var httpendpoint = getParameter("httpendpoint", "tunnel");
+ /* Should Window close on logout */
+ window.SELF_CLOSE = getParameter("selfclose", 0); /* if 1 then the window will close on logout if 0 then the logout will redirect, defaults to 0 */
switch (tunneltype) {
case 'http':
// Logout after warning user about session disconnect
if (confirm(GuacamoleUI.LOGOUT_PROMPT)) {
- window.location.href = "logout";
- GuacamoleUI.hideTouchMenu();
+ if(1 == window.SELF_CLOSE){
+ window.close();
+ }else{
+ window.location.href = "logout";
+ GuacamoleUI.hideTouchMenu();
+ }
}
};