source: trunk/server/swat2/esptest/session.esp@ 689

Last change on this file since 689 was 414, checked in by Herwig Bauernfeind, 16 years ago

Samba 3.5.0: Initial import

File size: 1.1 KB
Line 
1<% page_header("columns", "ESP session test", "esptest");
2 include("/scripting/forms.js");
3%>
4
5<h1>Samba4 session test</h1>
6
7<%
8var f = FormObj("SessionTest", 3, 4);
9f.element[0].label = "Name";
10f.element[1].label = "Value";
11f.element[2].label = "Timeout";
12f.submit[0] = "Append";
13f.submit[1] = "Reset";
14f.submit[2] = "Destroy";
15f.submit[3] = "Cancel";
16
17f.display();
18
19 /* if its a post then the user has filled in the form, so
20 report the values
21 */
22if (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 }
47}
48
49simple_table(session);
50write("SessionId=" + request['SESSION_ID'] + "<br/>\n");
51%>
52
53<% page_footer(); %>
Note: See TracBrowser for help on using the repository browser.