source: accountserver/src/main/webapp/index.jsp@ 642

Last change on this file since 642 was 95, checked in by wouter, 4 years ago

rename loggedin to welcome

File size: 1.6 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2<html>
3<head>
4<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
5<meta content="utf-8" http-equiv="encoding">
6<title>User Log in</title>
7</head>
8<body>
9 <center>
10 <fieldset style="width: 300px">
11 <legend> Login here </legend>
12 <table>
13 <tr>
14 <td>User name (required)</td>
15 <td><input type="text" id="name" name="username"
16 required="required" /></td>
17 </tr>
18 <tr>
19 <td>Password</td>
20 <td><input type="password" id="password" name="userpass"
21 required="required" /></td>
22 </tr>
23 <tr>
24 <td><button onClick="login()">Log in</button></td>
25 </tr>
26 </table>
27 </fieldset>
28 <br> <br>
29 <table>
30 <tr>
31 <td><a href="register.jsp">Register as new user<//a></td>
32 </tr>
33 <tr>
34 <td><a href="reset.jsp">I forgot my password<//a></td>
35 </tr>
36 </table>
37 </center>
38
39 <script>
40 "use strict";
41
42 function login() {
43 var xmlHttp = new XMLHttpRequest();
44 xmlHttp.open("POST", "Accounts", true);
45 xmlHttp.setRequestHeader('Content-Type', "text/json");
46 xmlHttp.onreadystatechange = function() {
47 if (xmlHttp.readyState == 4) {
48 if (xmlHttp.status == 200) {
49 window.location.href = "welcome.jsp";
50 } else {
51 alert("access denied!");
52 }
53 }
54 }
55 xmlHttp.send(JSON.stringify({
56 'name' : document.getElementById('name').value,
57 'password' : document.getElementById('password').value
58 }));
59
60 }
61 </script>
62
63 <noscript>Sorry, your browser does not support JavaScript!</noscript>
64</body>
65</html>
Note: See TracBrowser for help on using the repository browser.