r7087: always run the /scripting/preauth.esp page before processing any
[samba.git] / swat / esptest / exception.esp
1 <HTML>
2 <TITLE>
3 Samba4 ESP test
4 </TITLE>
5 <BODY>
6 <h1>Samba4 exception test</h1>
7
8 <form name="ExceptionTest" method="POST" action="@@request['SCRIPT_NAME']"> 
9     <input name="submit" type="submit" value="Generate Exception">
10     <input name="submit" type="submit" value="No Exception">
11     <input name="submit" type="submit" value="Cancel"><br>
12 </form>
13
14 <%
15 if (request['REQUEST_METHOD'] == "POST") {
16         /* if they cancelled then take them back to the list of tests */
17         if (form['submit'] == "Cancel") {
18                 redirect("index.esp");
19         }
20
21         function TestFunction(arg1, arg2) {
22                  return "OK";
23         }
24
25         if (form['submit'] == "Generate Exception") {
26             write("I expect you to die Mr Bond!<br>\n");
27             TestFunction("foo");
28         } else {
29             write("no exception<br>\n");
30             TestFunction("foo", "bar");
31         }
32 }
33 %>
34
35 and here is some filler text ...
36 </BODY>
37 </HTML>