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/formtest.esp | 41 ++++++++++++++++++++++++++++ swat/esptest/formtest.html | 41 ---------------------------- swat/esptest/include.esp | 22 +++++++++++++++ swat/esptest/include.html | 22 --------------- swat/esptest/index.esp | 23 ++++++++++++++++ swat/esptest/session.esp | 65 +++++++++++++++++++++++++++++++++++++++++++++ swat/esptest/showvars.esp | 35 ++++++++++++++++++++++++ swat/esptest/showvars.html | 32 ---------------------- swat/favicon.ico | Bin 0 -> 2238 bytes swat/index.esp | 11 ++++++++ swat/index.html | 11 -------- 11 files changed, 197 insertions(+), 106 deletions(-) create mode 100644 swat/esptest/formtest.esp delete mode 100644 swat/esptest/formtest.html create mode 100644 swat/esptest/include.esp delete mode 100644 swat/esptest/include.html create mode 100644 swat/esptest/index.esp create mode 100644 swat/esptest/session.esp create mode 100644 swat/esptest/showvars.esp delete mode 100644 swat/esptest/showvars.html create mode 100644 swat/favicon.ico create mode 100644 swat/index.esp delete mode 100644 swat/index.html (limited to 'swat') diff --git a/swat/esptest/formtest.esp b/swat/esptest/formtest.esp new file mode 100644 index 0000000000..7996900eb2 --- /dev/null +++ b/swat/esptest/formtest.esp @@ -0,0 +1,41 @@ + + +Samba4 ESP test + + +

Samba4 form test

+ +
+ firstName:
+ lastName:
+ +
+
+ +<% + /* 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"); + } +%> + You chose firstName=@@form['firstName'] lastName=@@form['lastName'] +<% + + function showArray(name, array) { + write("

Array: " + name + "

\n"); + for (v in array) { + write(name + "[" + v + "]=" + array[v] + "
\n"); + } + } + + showArray("form", form); + } +%> + + + diff --git a/swat/esptest/formtest.html b/swat/esptest/formtest.html deleted file mode 100644 index 8de25f76a5..0000000000 --- a/swat/esptest/formtest.html +++ /dev/null @@ -1,41 +0,0 @@ - - -Samba4 ESP test - - -

Samba4 form test

- -
- firstName:
- lastName:
- -
-
- -<% - /* 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.html"); - } -%> - You chose firstName=@@form['firstName'] lastName=@@form['lastName'] -<% - - function showArray(name, array) { - write("

Array: " + name + "

\n"); - for (v in array) { - write(name + "[" + v + "]=" + array[v] + "
\n"); - } - } - - showArray("form", form); - } -%> - - - diff --git a/swat/esptest/include.esp b/swat/esptest/include.esp new file mode 100644 index 0000000000..9b67a768da --- /dev/null +++ b/swat/esptest/include.esp @@ -0,0 +1,22 @@ + + +Samba4 ESP test + + +including /scripting/test.ejs

+<% include("/scripting/test.ejs"); %> +calling a function from test.ejs ...

+<% showArray("request", request); %> + +including /scripting/test.esp

+<% include /scripting/test.esp %> +calling a function from test.esp ...

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

+
+
+ + + diff --git a/swat/esptest/include.html b/swat/esptest/include.html deleted file mode 100644 index 59322cc9fa..0000000000 --- a/swat/esptest/include.html +++ /dev/null @@ -1,22 +0,0 @@ - - -Samba4 ESP test - - -including /scripting/test.ejs

-<% include("/scripting/test.ejs"); %> -calling a function from test.ejs ...

-<% showArray("request", request); %> - -including /scripting/test.esp

-<% include /scripting/test.esp %> -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 0000000000..f229732e3e --- /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 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"); +%> + + + diff --git a/swat/esptest/showvars.esp b/swat/esptest/showvars.esp new file mode 100644 index 0000000000..04bfb7b1f6 --- /dev/null +++ b/swat/esptest/showvars.esp @@ -0,0 +1,35 @@ + + +Samba4 ESP test + + +

Samba4 showvars test

+ +<% + function showArray(name, array) { + write("

Array: " + name + "

\n"); + if (array == undefined) { + write("undefined
\n"); + } else { + for (v in array) { + write(name + "[" + v + "]=" + array[v] + "
\n"); + } + } + } + + showArray("headers", headers); + showArray("application", application); + showArray("cookies", cookies); + showArray("files", files); + showArray("request", request); + showArray("server", server); + showArray("session", session); +%> + +
+
+
+ + + + diff --git a/swat/esptest/showvars.html b/swat/esptest/showvars.html deleted file mode 100644 index 4c4a5b93f4..0000000000 --- a/swat/esptest/showvars.html +++ /dev/null @@ -1,32 +0,0 @@ - - -Samba4 ESP test - - -

Samba4 showvars test

- -<% - function showArray(name, array) { - write("

Array: " + name + "

\n"); - for (v in array) { - write(name + "[" + v + "]=" + array[v] + "
\n"); - } - } - - showArray("form", form); - showArray("headers", headers); - showArray("application", application); - showArray("cookies", cookies); - showArray("files", files); - showArray("request", request); - showArray("server", server); - showArray("session", session); -%> - -
-
-
- - - - diff --git a/swat/favicon.ico b/swat/favicon.ico new file mode 100644 index 0000000000..ef903bacfe Binary files /dev/null and b/swat/favicon.ico differ diff --git a/swat/index.esp b/swat/index.esp new file mode 100644 index 0000000000..7023a9e102 --- /dev/null +++ b/swat/index.esp @@ -0,0 +1,11 @@ + + +Samba4 ESP test + + +redirecting you to the test pages ... +<% + redirect("esptest/index.esp"); +%> + + diff --git a/swat/index.html b/swat/index.html deleted file mode 100644 index 644eeebd61..0000000000 --- a/swat/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - -Samba4 ESP test - - -redirecting you to the test pages ... -<% - redirect("esptest/index.html"); -%> - - -- cgit