r7134: a number of small changes to make the pages HTML compliant. The
[kai/samba.git] / swat / login.esp
1 <% page_header("plain", "SWAT Login"); %>
2
3 <%
4
5 if (request['SESSION_EXPIRED'] == "True") {
6    write("<b>Your session has expired - please authenticate again<br /></b>\n");
7 }
8
9 var f = FormObj("login", 2, 1);
10 f.element[0].label = "Username";
11 f.element[0].value = form['Username'];
12 f.element[1].label = "Password";
13 f.element[1].value = form['Password'];
14 f.element[1].type  = "password";
15 f.submit[0] = "Login";
16
17 display_form(f);
18 %>
19
20 <%
21         if (request.REQUEST_METHOD == "POST") {
22                 /* for now just authenticate everyone */
23                 session.AUTHENTICATED = true;
24                 session.authinfo = new Object();
25
26                 session.authinfo.username = form.Username;
27
28                 /* if the user was asking for the login page, then now
29                    redirect them to the main page. Otherwise just
30                    redirect them to the current page, which will now
31                    show its true content */
32                 if (request.REQUEST_URI == "/login.esp") {
33                    redirect(session_uri("/"));
34                 } else {
35                    redirect(session_uri(request.REQUEST_URI));
36                 }
37         }
38 %>
39 <% page_footer(); %>