diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vlad3.ur | 27 | ||||
-rw-r--r-- | tests/vlad3.urp | 2 | ||||
-rw-r--r-- | tests/vlad3.urs | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/vlad3.ur b/tests/vlad3.ur new file mode 100644 index 00000000..3d1e812b --- /dev/null +++ b/tests/vlad3.ur @@ -0,0 +1,27 @@ +cookie user : {EMail : string} + +fun main () = + ro <- getCookie user; + case ro of + Some u => welcome u + | _ => login () + +and welcome u = return <xml><body> + Welcome {[u.EMail]}. <a link={logout ()}>Logout</a> +</body></xml> + +and logout () = + clearCookie user; + main () + +and login () = return <xml><body> + <form>E-mail:<textbox{#EMail}/><submit action={signin}/></form> +</body></xml> + +and signin r = + setCookie user {Value = {EMail = r.EMail}, + Expires = None, (* Some (readError "2012-11-6 +00:00:00"), *) + Secure = False + }; + main () diff --git a/tests/vlad3.urp b/tests/vlad3.urp new file mode 100644 index 00000000..3a0fa1f3 --- /dev/null +++ b/tests/vlad3.urp @@ -0,0 +1,2 @@ + +vlad3 diff --git a/tests/vlad3.urs b/tests/vlad3.urs new file mode 100644 index 00000000..6ac44e0b --- /dev/null +++ b/tests/vlad3.urs @@ -0,0 +1 @@ +val main : unit -> transaction page |