1: <html>
2: <!-- $Id: logon.tmpl,v 1.1.1.1 2012/02/21 23:25:53 misho Exp $ -->
3: <head>
4: <title>HTTP server demo page</title>
5: </head>
6: <body bgcolor="#ffffff">
7:
8: <h3>Authorization</h3>
9:
10: @if(@equal(@query("button"), ""))
11:
12: <form action="/logon">
13:
14: <p>
15: This servlet is implemented via the http_servlet_tmpl(3) servlet
16: using the template file "logon.tmpl".
17:
18: <p>
19: This logon page also tests the http_servlet_cookieauth(3) servlet.
20:
21: <p>
22: @if(@equal(@authname(), ""))
23: You are currently not logged in.
24:
25: <p>
26: Enter authorization time:
27: <select name="time">
28: <option value="2">2 seconds</option>
29: <option value="10">10 seconds</option>
30: <option value="60">1 minute</option>
31: <option value="300">5 minutes</option>
32: <option value="3600">1 hour</option>
33: <option value="0" selected>While browser open</option>
34: </select>
35:
36: <p>
37: Enter your name here: <input type="text" name="name" size="12">
38:
39: <p>
40: Press here to login: <input type="submit" name="button" value="Login">
41:
42: @if(@not(@equal(@query_string(), "")))
43: <input type="hidden" name="redirect"
44: value="@htmlencode(@query_string())">
45: @endif
46:
47: @else
48: You currently logged in as "@authname()".
49:
50: <p>
51: Click <a href="/">HERE</a> to continue with more servlet demos.
52:
53: <p>
54: Click <a href="/logon">HERE</a> to reload this page.
55:
56: <p>
57: Press here to logout: <input type="submit" name="button" value="Logout">
58: <input type="hidden" name="name" value="@authname()">
59: @endif
60:
61: </form>
62:
63: @elif(@equal(@query("button"), "Logout"))
64:
65: <p>
66: Logging out "@query("name")"...
67:
68: <p>
69: @authorize("")
70:
71: <p>
72: Click <a href="/logon">HERE</a> to continue.
73:
74: @else
75:
76: <p>
77: Logging you in as "@query("name")"...
78:
79: @if(@query("time"))
80: <p>
81: Logon valid for @query("time") seconds.
82: @endif
83:
84: <p>
85: @authorize(@query("name"), @query("time"))
86:
87: @if(@not(@equal(@query("redirect"), "")))
88: <p>
89: Click <a href="@query("redirect")">HERE</a> to continue on to
90: <b>@htmlencode(@query("redirect"))</b>
91: @else
92: <p>
93: Click <a href="/logon">HERE</a> to continue.
94: @endif
95:
96:
97: @endif
98:
99: </body>
100: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>