diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-05-26 02:08:12 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:17:02 -0500 |
commit | fd82bfce3dd95de1b98fc9bf26ea2a2f9bcc0d00 (patch) | |
tree | 6669889ccdbe0361c294038ac54ff3b36faf4b79 | |
parent | 7e582319528b674d5f7603409e357138194a0ab1 (diff) | |
download | samba-fd82bfce3dd95de1b98fc9bf26ea2a2f9bcc0d00.tar.gz samba-fd82bfce3dd95de1b98fc9bf26ea2a2f9bcc0d00.tar.bz2 samba-fd82bfce3dd95de1b98fc9bf26ea2a2f9bcc0d00.zip |
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)
-rw-r--r-- | swat/html/esptest/formtest.html | 41 | ||||
-rw-r--r-- | swat/html/esptest/index.html | 23 | ||||
-rw-r--r-- | swat/html/esptest/showvars.html | 32 | ||||
-rw-r--r-- | swat/html/images/logo.png | bin | 0 -> 9329 bytes | |||
-rw-r--r-- | swat/html/index.html | 11 | ||||
-rw-r--r-- | swat/scripting/test.ejs | 10 |
6 files changed, 117 insertions, 0 deletions
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 @@ +<HTML> +<TITLE> +Samba4 ESP test +</TITLE> +<BODY> +<h1>Samba4 form test</h1> + +<form name="FormTest" method="POST" action="@@request['SCRIPT_NAME']"> + firstName: <input name="firstName" type="text" value=""><br> + lastName: <input name="lastName" type="text" value=""><br> + <input name="submit" type="submit" value="OK"> + <input name="submit" type="submit" value="Cancel"><br> +</form> + +<% + /* 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("<h3>Array: " + name + "</h3>\n"); + for (v in array) { + write(name + "[" + v + "]=" + array[v] + "<br>\n"); + } + } + + showArray("form", form); + } +%> + +</BODY> +</HTML> 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"); +%> + +<HTML> +<TITLE> +Samba4 ESP test +</TITLE> +<BODY> +<img src="/images/logo.png" alt="Samba"> +<h1>Samba4 ESP test</h1> + +Please choose one of the following tests: +<ul> +<% + for (test in tests) { + url = tests[test] + ".html"; + write("<li> <a href=" + url + ">" + tests[test] + "</a>"); + } +%> +</ul> +</BODY> +</HTML> 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 @@ +<HTML> +<TITLE> +Samba4 ESP test +</TITLE> +<BODY> +<h1>Samba4 showvars test</h1> + +<% + function showArray(name, array) { + write("<h3>Array: " + name + "</h3>\n"); + for (v in array) { + write(name + "[" + v + "]=" + array[v] + "<br>\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); +%> + +<form name="Cancel" method="POST" action="index.html"> + <input name="submit" type="submit" value="Cancel"><br> +</form> + +</ul> +</BODY> +</HTML> diff --git a/swat/html/images/logo.png b/swat/html/images/logo.png Binary files differnew file mode 100644 index 0000000000..6df4ace659 --- /dev/null +++ b/swat/html/images/logo.png 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 @@ +<HTML> +<TITLE> +Samba4 ESP test +</TITLE> +<BODY> +redirecting you to the test pages ... +<% + redirect("esptest/index.html"); +%> +</BODY> +</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("<h3>Array: " + name + "</h3>\n"); + for (v in array) { + write(name + "[" + v + "]=" + array[v] + "<br>\n"); + } +} |