svn commit: samba r6983 - in branches/SAMBA_4_0: . swat swat/html swat/html/esptest swat/html/images swat/scripting

tridge at samba.org tridge at samba.org
Thu May 26 02:08:12 GMT 2005


Author: tridge
Date: 2005-05-26 02:08:12 +0000 (Thu, 26 May 2005)
New Revision: 6983

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6983

Log:
add some sample esp pages to demonstrate the use of some of the features of the server
side scripting language


Added:
   branches/SAMBA_4_0/swat/
   branches/SAMBA_4_0/swat/html/
   branches/SAMBA_4_0/swat/html/esptest/
   branches/SAMBA_4_0/swat/html/esptest/formtest.html
   branches/SAMBA_4_0/swat/html/esptest/index.html
   branches/SAMBA_4_0/swat/html/esptest/showvars.html
   branches/SAMBA_4_0/swat/html/images/
   branches/SAMBA_4_0/swat/html/images/logo.png
   branches/SAMBA_4_0/swat/html/index.html
   branches/SAMBA_4_0/swat/scripting/
   branches/SAMBA_4_0/swat/scripting/test.ejs


Changeset:
Added: branches/SAMBA_4_0/swat/html/esptest/formtest.html
===================================================================
--- branches/SAMBA_4_0/swat/html/esptest/formtest.html	2005-05-26 02:06:33 UTC (rev 6982)
+++ branches/SAMBA_4_0/swat/html/esptest/formtest.html	2005-05-26 02:08:12 UTC (rev 6983)
@@ -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>

Added: branches/SAMBA_4_0/swat/html/esptest/index.html
===================================================================
--- branches/SAMBA_4_0/swat/html/esptest/index.html	2005-05-26 02:06:33 UTC (rev 6982)
+++ branches/SAMBA_4_0/swat/html/esptest/index.html	2005-05-26 02:08:12 UTC (rev 6983)
@@ -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>

Added: branches/SAMBA_4_0/swat/html/esptest/showvars.html
===================================================================
--- branches/SAMBA_4_0/swat/html/esptest/showvars.html	2005-05-26 02:06:33 UTC (rev 6982)
+++ branches/SAMBA_4_0/swat/html/esptest/showvars.html	2005-05-26 02:08:12 UTC (rev 6983)
@@ -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>

Added: branches/SAMBA_4_0/swat/html/images/logo.png
===================================================================
(Binary files differ)


Property changes on: branches/SAMBA_4_0/swat/html/images/logo.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/SAMBA_4_0/swat/html/index.html
===================================================================
--- branches/SAMBA_4_0/swat/html/index.html	2005-05-26 02:06:33 UTC (rev 6982)
+++ branches/SAMBA_4_0/swat/html/index.html	2005-05-26 02:08:12 UTC (rev 6983)
@@ -0,0 +1,11 @@
+<HTML>
+<TITLE>
+Samba4 ESP test
+</TITLE>
+<BODY>
+redirecting you to the test pages ...
+<%
+  redirect("esptest/index.html");
+%>
+</BODY>
+</HTML>

Added: branches/SAMBA_4_0/swat/scripting/test.ejs
===================================================================
--- branches/SAMBA_4_0/swat/scripting/test.ejs	2005-05-26 02:06:33 UTC (rev 6982)
+++ branches/SAMBA_4_0/swat/scripting/test.ejs	2005-05-26 02:08:12 UTC (rev 6983)
@@ -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");
+    }
+}



More information about the samba-cvs mailing list