5d12af22584ddb47a39646a73115561671161487
[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.submit[0] = "Login";
8
9 display_form(f);
10 %>
11
12 <%
13         if (request.REQUEST_METHOD == "POST") {
14                 /* for now just authenticate everyone */
15                 session.AUTHENTICATED = true;
16                 session.authinfo = new Object();
17
18                 session.authinfo.username = form.Username;
19
20                 /* if the user was asking for the login page, then now
21                    redirect them to the main page. Otherwise just
22                    redirect them to the current page, which will now
23                    show its true content */
24                 if (request.REQUEST_URI == "/login.esp") {
25                    redirect("/");
26                 } else {
27                    redirect(request.REQUEST_URI);
28                 }
29         }
30 %>
31 <% page_footer(); %>