From 26a8394ee92443ce2a9688bc01a02df4c2ad74fa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 27 May 2005 00:31:41 +0000 Subject: r6999: - renamed our html files to esp - added a favicon.ico so bookmarks show a samba icon - added a session.esp demonstration of session variables (This used to be commit 092ffc733916f8091c8ff1e7a1306810e516d613) --- swat/esptest/session.esp | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 swat/esptest/session.esp (limited to 'swat/esptest/session.esp') diff --git a/swat/esptest/session.esp b/swat/esptest/session.esp new file mode 100644 index 0000000000..e1d6a6370d --- /dev/null +++ b/swat/esptest/session.esp @@ -0,0 +1,65 @@ + + +Samba4 ESP test + + +

Samba4 session test

+ +
+ Name:
+ Value:
+ Timeout:
+ + + +
+
+ +<% + /* if its a post then the user has filled in the form, so + report the values + */ +if (request['REQUEST_METHOD'] == "POST") { + /* if they cancelled then take them back to the list of tests */ + if (form['submit'] == "Cancel") { + redirect("index.esp"); + } + + name = form['Name']; + value = form['Value']; + timeout = form['Timeout']; + + if (timeout) { + useSession(timeout); + } + + if (form['submit'] == "Reset" && name) { + session[name] = null; + } + + if (form['submit'] == "Append" && name) { + session[name] = "" + session[name] + value; + } + + if (form['submit'] == "Destroy") { + destroySession(); + } +} + +function showArray(name, array) { + write("

Array: " + name + "

\n"); + if (array == undefined) { + write("undefined
\n"); + return; + } + for (v in array) { + write(name + "[" + v + "]=" + array[v] + "
\n"); + } +} + +showArray("session", session); +write("SessionId=" + request['SESSION_ID'] + "
\n"); +%> + + + -- cgit