r7099: make the password field a password field...
[samba.git] / swat / login.esp
1 <% page_header("plain", "SWAT Login"); %>
2
3 <%
4 var f = Form("login", 2, 1);
5 f.element[0].label = "Username";
6 f.element[1].label = "Password";
7 f.element[1].type  = "password";
8 f.submit[0] = "Login";
9
10 display_form(f);
11 %>
12
13 <%
14         if (request.REQUEST_METHOD == "POST") {
15                 /* for now just authenticate everyone */
16                 session.AUTHENTICATED = true;
17                 session.authinfo = new Object();
18
19                 session.authinfo.username = form.Username;
20
21                 /* if the user was asking for the login page, then now
22                    redirect them to the main page. Otherwise just
23                    redirect them to the current page, which will now
24                    show its true content */
25                 if (request.REQUEST_URI == "/login.esp") {
26                    redirect("/");
27                 } else {
28                    redirect(request.REQUEST_URI);
29                 }
30         }
31 %>
32 <% page_footer(); %>