comparison src/ur/openidUser.ur @ 31:1be573ac8e2b

Add some formatting options to the user control xml.
author Karn Kallio <kkallio@eka>
date Mon, 18 Apr 2011 01:20:39 -0430
parents 5d6337df5ec7
children 90b8ce9be9f5
comparison
equal deleted inserted replaced
30:5d6337df5ec7 31:1be573ac8e2b
26 val secureCookies : bool 26 val secureCookies : bool
27 val association : Openid.association_mode 27 val association : Openid.association_mode
28 val realm : option string 28 val realm : option string
29 val formClass : css_class 29 val formClass : css_class
30 val fakeId : option string 30 val fakeId : option string
31
32 val ctlDisplay : {User : {Status : xbody, Other : xbody},
33 Guest : {Status : xbody, Other : xbody}}
31 end) = struct 34 end) = struct
32 35
33 type user = string 36 type user = string
34 val eq_user = _ 37 val eq_user = _
35 val read_user = _ 38 val read_user = _
294 end 297 end
295 in 298 in
296 cur <- current; 299 cur <- current;
297 here <- currentUrl; 300 here <- currentUrl;
298 case cur of 301 case cur of
299 Some cur => return {Status = <xml>Logged in as {[cur]}.</xml>, 302 Some cur => return {Status = <xml>{M.ctlDisplay.User.Status}{[cur]}</xml>,
300 Other = <xml><a link={logout ()}>Log out</a></xml>} 303 Other = <xml><a link={logout ()}>{M.ctlDisplay.User.Other}</a></xml>}
301 | None => return {Status = <xml><form><textbox{#User}/> <submit value="Log In" action={logon (show here)}/></form></xml>, 304 | None => return {Status = <xml>{M.ctlDisplay.Guest.Status}<form><textbox{#User}/> <submit value="Log In" action={logon (show here)}/></form></xml>,
302 Other = <xml><a link={signup (show here)}>Sign up</a></xml>} 305 Other = <xml><a link={signup (show here)}>{M.ctlDisplay.Guest.Other}</a></xml>}
303 end 306 end
304 307
305 task periodic 60 = fn () => dml (DELETE FROM session 308 task periodic 60 = fn () => dml (DELETE FROM session
306 WHERE Expires < CURRENT_TIMESTAMP) 309 WHERE Expires < CURRENT_TIMESTAMP)
307 310