r7106: the web interface now works completely with or without cookies. If you have...
[kai/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[0].value = form['Username'];
7 f.element[1].label = "Password";
8 f.element[1].value = form['Password'];
9 f.element[1].type  = "password";
10 f.submit[0] = "Login";
11
12 display_form(f);
13 %>
14
15 <%
16         if (request.REQUEST_METHOD == "POST") {
17                 /* for now just authenticate everyone */
18                 session.AUTHENTICATED = true;
19                 session.authinfo = new Object();
20
21                 session.authinfo.username = form.Username;
22
23                 /* if the user was asking for the login page, then now
24                    redirect them to the main page. Otherwise just
25                    redirect them to the current page, which will now
26                    show its true content */
27                 if (request.REQUEST_URI == "/login.esp") {
28                    redirect(session_uri("/"));
29                 } else {
30                    redirect(session_uri(request.REQUEST_URI));
31                 }
32         }
33 %>
34 <% page_footer(); %>