1 <?xml version="1.0" encoding="UTF-8"?>
5 Guacamole - Clientless Remote Desktop
6 Copyright (C) 2010 Michael Jumper
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Affero General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Affero General Public License for more details.
18 You should have received a copy of the GNU Affero General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 <html xmlns="http://www.w3.org/1999/xhtml">
25 <link rel="icon" type="image/png" href="images/guacamole-logo-64.png"/>
26 <link rel="stylesheet" type="text/css" href="styles/login.css"/>
27 <title>Guacamole ${project.version}</title>
32 <div id="login-ui" style="display: none">
33 <div id="login-dialog-middle">
35 <div id="login-dialog">
37 <p id="login-error"></p>
39 <form id="login-form" action="#" method="post">
41 <div id="login-fields">
45 <td><input type="text" name="username" id="username" autofocus="autofocus"/></td>
49 <td><input type="password" name="password" id="password"/></td>
53 <img class="logo" src="images/guacamole-logo-64.png" alt=""/>
57 <input type="submit" name="login" id="login" value="Login"/>
66 <!-- Connection list UI -->
67 <div id="connection-list-ui" style="display: none">
70 <img class="logo" src="images/guacamole-logo-64.png" alt=""/>
74 <table class="connections">
84 <td>zhz@localhost</td>
86 <td class="description">Connect to test.guac-dev.org via vnc.</td>
89 <td>zhz@localhost</td>
91 <td class="description">Connect to test.guac-dev.org via ssh.</td>
98 <div id="version-dialog">
99 Guacamole ${project.version}
103 <script type="text/javascript"> /* <![CDATA[ */
105 var loginForm = document.getElementById("login-form");
106 var loginUI = document.getElementById("login-ui");
107 var connectionListUI = document.getElementById("connection-list-ui");
109 // TODO: Get connection list
110 // On no-auth fail, show login UI
112 loginForm.onsubmit = function() {
114 var username = document.getElementById("username");
115 var password = document.getElementById("password");
118 "username=" + encodeURIComponent(username.value)
119 + "&password=" + encodeURIComponent(password.value)
124 var xhr = new XMLHttpRequest();
125 xhr.open("POST", "login", false);
126 xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
130 if (xhr.status != 200)
131 throw new Error("Invalid login");
133 // Hide login UI, display connections
134 loginUI.style.display = "none";
135 connectionListUI.style.display = "";
140 var loginError = document.getElementById("login-error");
142 // Display error, reset and refocus password field
143 loginError.textContent = e.message;
151 // On success, hide loginUI, get and show connection list.
156 loginUI.style.display = "";