From: Andrew Tridgell Date: Fri, 27 May 2005 00:31:41 +0000 (+0000) Subject: r6999: - renamed our html files to esp X-Git-Tag: samba-4.0.0alpha6~801^3~10894 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=26a8394ee92443ce2a9688bc01a02df4c2ad74fa 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) --- diff --git a/swat/esptest/formtest.html b/swat/esptest/formtest.esp similarity index 97% rename from swat/esptest/formtest.html rename to swat/esptest/formtest.esp index 8de25f76a5d..7996900eb21 100644 --- a/swat/esptest/formtest.html +++ b/swat/esptest/formtest.esp @@ -20,7 +20,7 @@ Samba4 ESP test /* if they cancelled then take them back to the list of tests */ if (form['submit'] == "Cancel") { - redirect("index.html"); + redirect("index.esp"); } %> You chose firstName=@@form['firstName'] lastName=@@form['lastName'] diff --git a/swat/esptest/include.html b/swat/esptest/include.esp similarity index 88% rename from swat/esptest/include.html rename to swat/esptest/include.esp index 59322cc9fa6..9b67a768da5 100644 --- a/swat/esptest/include.html +++ b/swat/esptest/include.esp @@ -14,7 +14,7 @@ calling a function from test.esp ...

<% res = testfn('foo'); %> result is: @@res -

+
diff --git a/swat/esptest/index.esp b/swat/esptest/index.esp new file mode 100644 index 00000000000..f229732e3e3 --- /dev/null +++ b/swat/esptest/index.esp @@ -0,0 +1,23 @@ +<% + var tests = new Array("formtest", "showvars", "include", "session"); +%> + + + +Samba4 ESP test + + +Samba +

Samba4 ESP test

+ +Please choose one of the following tests: + + + diff --git a/swat/esptest/session.esp b/swat/esptest/session.esp new file mode 100644 index 00000000000..e1d6a6370d9 --- /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"); +%> + + + diff --git a/swat/esptest/showvars.html b/swat/esptest/showvars.esp similarity index 68% rename from swat/esptest/showvars.html rename to swat/esptest/showvars.esp index 4c4a5b93f44..04bfb7b1f62 100644 --- a/swat/esptest/showvars.html +++ b/swat/esptest/showvars.esp @@ -8,12 +8,15 @@ Samba4 ESP test <% function showArray(name, array) { write("

Array: " + name + "

\n"); - for (v in array) { - write(name + "[" + v + "]=" + array[v] + "
\n"); + if (array == undefined) { + write("undefined
\n"); + } else { + for (v in array) { + write(name + "[" + v + "]=" + array[v] + "
\n"); + } } } - showArray("form", form); showArray("headers", headers); showArray("application", application); showArray("cookies", cookies); @@ -23,7 +26,7 @@ Samba4 ESP test showArray("session", session); %> -
+
diff --git a/swat/favicon.ico b/swat/favicon.ico new file mode 100644 index 00000000000..ef903bacfe8 Binary files /dev/null and b/swat/favicon.ico differ diff --git a/swat/index.html b/swat/index.esp similarity index 75% rename from swat/index.html rename to swat/index.esp index 644eeebd619..7023a9e102e 100644 --- a/swat/index.html +++ b/swat/index.esp @@ -5,7 +5,7 @@ Samba4 ESP test redirecting you to the test pages ... <% - redirect("esptest/index.html"); + redirect("esptest/index.esp"); %>