r7134: a number of small changes to make the pages HTML compliant. The
[samba.git] / swat / esptest / session.esp
1 <% page_header("columns", "ESP session test"); %>
2
3 <h1>Samba4 session test</h1>
4
5 <%
6 var f = FormObj("SessionTest", 3, 4);
7 f.element[0].label = "Name";
8 f.element[1].label = "Value";
9 f.element[2].label = "Timeout";
10 f.submit[0] = "Append";
11 f.submit[1] = "Reset";
12 f.submit[2] = "Destroy";
13 f.submit[3] = "Cancel";
14
15 display_form(f);
16
17   /* if its a post then the user has filled in the form, so
18      report the values 
19   */
20 if (request['REQUEST_METHOD'] == "POST") {
21         /* if they cancelled then take them back to the list of tests */
22         if (form['submit'] == "Cancel") {
23                 redirect("/");
24         }
25         
26         name  = form['Name'];
27         value = form['Value'];
28         timeout = form['Timeout'];
29         
30         if (timeout) {
31                 useSession(timeout);
32         }
33         
34         if (form['submit'] == "Reset" && name) {
35                 session[name] = null;
36         }
37         
38         if (form['submit'] == "Append" && name) {
39                 session[name] = "" + session[name] + value;
40         }
41         
42         if (form['submit'] == "Destroy") {
43                 destroySession();
44         }
45 }
46
47 simple_table(session);
48 write("SessionId=" + request['SESSION_ID'] + "<br/>\n");
49 %>
50
51 <% page_footer(); %>