From fd82bfce3dd95de1b98fc9bf26ea2a2f9bcc0d00 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 26 May 2005 02:08:12 +0000 Subject: r6983: add some sample esp pages to demonstrate the use of some of the features of the server side scripting language (This used to be commit 519608bbf9c2a032261c00fce9a4f84eb73d1a9e) --- swat/html/esptest/formtest.html | 41 ++++++++++++++++++++++++++++++++++++++++ swat/html/esptest/index.html | 23 ++++++++++++++++++++++ swat/html/esptest/showvars.html | 32 +++++++++++++++++++++++++++++++ swat/html/images/logo.png | Bin 0 -> 9329 bytes swat/html/index.html | 11 +++++++++++ swat/scripting/test.ejs | 10 ++++++++++ 6 files changed, 117 insertions(+) create mode 100644 swat/html/esptest/formtest.html create mode 100644 swat/html/esptest/index.html create mode 100644 swat/html/esptest/showvars.html create mode 100644 swat/html/images/logo.png create mode 100644 swat/html/index.html create mode 100644 swat/scripting/test.ejs (limited to 'swat') diff --git a/swat/html/esptest/formtest.html b/swat/html/esptest/formtest.html new file mode 100644 index 0000000000..8de25f76a5 --- /dev/null +++ b/swat/html/esptest/formtest.html @@ -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.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/html/esptest/index.html b/swat/html/esptest/index.html new file mode 100644 index 0000000000..957e7d94fa --- /dev/null +++ b/swat/html/esptest/index.html @@ -0,0 +1,23 @@ +<% + var tests = new Array("formtest", "showvars"); +%> + + + +Samba4 ESP test + + +Samba +

Samba4 ESP test

+ +Please choose one of the following tests: + + + diff --git a/swat/html/esptest/showvars.html b/swat/html/esptest/showvars.html new file mode 100644 index 0000000000..4c4a5b93f4 --- /dev/null +++ b/swat/html/esptest/showvars.html @@ -0,0 +1,32 @@ + + +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/html/images/logo.png b/swat/html/images/logo.png new file mode 100644 index 0000000000..6df4ace659 Binary files /dev/null and b/swat/html/images/logo.png differ diff --git a/swat/html/index.html b/swat/html/index.html new file mode 100644 index 0000000000..644eeebd61 --- /dev/null +++ b/swat/html/index.html @@ -0,0 +1,11 @@ + + +Samba4 ESP test + + +redirecting you to the test pages ... +<% + redirect("esptest/index.html"); +%> + + diff --git a/swat/scripting/test.ejs b/swat/scripting/test.ejs new file mode 100644 index 0000000000..e69df9230f --- /dev/null +++ b/swat/scripting/test.ejs @@ -0,0 +1,10 @@ + +/* + some test ejs code +*/ +function showArray(name, array) { + write("

Array: " + name + "

\n"); + for (v in array) { + write(name + "[" + v + "]=" + array[v] + "
\n"); + } +} -- cgit