comparison src/ur/openidUser.ur @ 20:2342d9baa0df

New OpenidUser.Make parameter: ready
author Adam Chlipala <adam@chlipala.net>
date Thu, 06 Jan 2011 16:46:09 -0500
parents dd8eb53da51b
children 354dae3008de
comparison
equal deleted inserted replaced
19:5e03668972ea 20:2342d9baa0df
6 6
7 type creationState 7 type creationState
8 type creationData 8 type creationData
9 val creationState : transaction creationState 9 val creationState : transaction creationState
10 val render : creationState -> xtable 10 val render : creationState -> xtable
11 val ready : creationState -> signal bool
11 val tabulate : creationState -> signal creationData 12 val tabulate : creationState -> signal creationData
12 val choose : sql_table ([Id = string] ++ cols) [Pkey = [Id]] -> creationData -> transaction $cols 13 val choose : sql_table ([Id = string] ++ cols) [Pkey = [Id]] -> creationData -> transaction $cols
13 14
14 val sessionLifetime : int 15 val sessionLifetime : int
15 val afterLogout : url 16 val afterLogout : url
115 116
116 wrap "Your User Details" <xml> 117 wrap "Your User Details" <xml>
117 <table class={M.formClass}> 118 <table class={M.formClass}>
118 <tr> <th class={M.formClass}>Username:</th> <td><ctextbox source={uid}/></td> </tr> 119 <tr> <th class={M.formClass}>Username:</th> <td><ctextbox source={uid}/></td> </tr>
119 {M.render cs} 120 {M.render cs}
120 <tr> <td><button value="Create Account" onclick={uid <- get uid; 121 <tr> <td><dyn signal={b <- M.ready cs;
121 data <- Basis.current (M.tabulate cs); 122 return (if b then
122 res <- rpc (finishSignup uid data); 123 <xml><button value="Create Account"
123 case res of 124 onclick={uid <- get uid;
124 None => redirect (bless after) 125 data <- Basis.current (M.tabulate cs);
125 | Some msg => alert msg}/></td> </tr> 126 res <- rpc (finishSignup uid data);
127 case res of
128 None => redirect (bless after)
129 | Some msg => alert msg}/></xml>
130 else
131 <xml/>)}/></td> </tr>
126 </table> 132 </table>
127 </xml> 133 </xml>
128 end 134 end
129 135
130 fun opCallback after ses res = 136 fun opCallback after ses res =