s4:registry library - fix up "reg_ldb_set_value"
[Samba/nascimento.git] / swat2 / esptest / session.esp
blob6213dde62f2c2324f3305f824911a3274b5ef853
1 <% page_header("columns", "ESP session test", "esptest"); 
2    include("/scripting/forms.js");
3 %>
5 <h1>Samba4 session test</h1>
7 <%
8 var f = FormObj("SessionTest", 3, 4);
9 f.element[0].label = "Name";
10 f.element[1].label = "Value";
11 f.element[2].label = "Timeout";
12 f.submit[0] = "Append";
13 f.submit[1] = "Reset";
14 f.submit[2] = "Destroy";
15 f.submit[3] = "Cancel";
17 f.display();
19   /* if its a post then the user has filled in the form, so
20      report the values 
21   */
22 if (request['REQUEST_METHOD'] == "POST") {
23         /* if they cancelled then take them back to the list of tests */
24         if (form['submit'] == "Cancel") {
25                 redirect("/");
26         }
27         
28         name  = form['Name'];
29         value = form['Value'];
30         timeout = form['Timeout'];
31         
32         if (timeout) {
33                 useSession(timeout);
34         }
35         
36         if (form['submit'] == "Reset" && name) {
37                 session[name] = null;
38         }
39         
40         if (form['submit'] == "Append" && name) {
41                 session[name] = "" + session[name] + value;
42         }
43         
44         if (form['submit'] == "Destroy") {
45                 destroySession();
46         }
49 simple_table(session);
50 write("SessionId=" + request['SESSION_ID'] + "<br/>\n");
53 <% page_footer(); %>