Permalink
Browse files

Added success and error pages for the email verification

  • Loading branch information...
Joony committed Jul 29, 2009
1 parent b7cba96 commit fd75098f77aa2a8a2284388e4adb75443db8041b
Binary file not shown.
Binary file not shown.
@@ -6,20 +6,30 @@ main() ->
[Code] = wf:q("key"),
case db_users:verify_email(Code) of
{atomic,ok} ->
- io:format("Everything looks ok~n");
+ Validated = true,
+ %io:format("Everything looks ok~n");
{aborted, "invalid verification code"} ->
- io:format("Invalid verification code~n");
+ Validated = false,
+ wf:redirect("/web/errors/verification/email"),
+ %io:format("Invalid verification code~n");
_ ->
- io:format("Something went wrong~n")
+ Validated = false,
+ wf:redirect("/web/errors/unexpected"),
+ %io:format("Something went wrong~n")
end,
-
-#template { file="./wwwroot/template.html"}.
+ #template { file="./wwwroot/validation.html", bindings=[{'Validated', Validated}] }.
title() ->
"web_users_verify_email".
-body() ->
- #label{text="web_users_verify_email body."}.
+body(Validated) ->
+ io:format("Validated = ~s~n", [Validated]),
+ case Validated of
+ true ->
+ #label{text="Your email address has been successfully validated"};
+ _ ->
+ #label{text="There was a problem validating your email address"}
+ end.
event(_) -> ok.
View
@@ -19,7 +19,6 @@ <h1>[[[page:title()]]]</h1>
[[[page:body()]]]
-
<script>
[[[script]]]
</script>

0 comments on commit fd75098

Please sign in to comment.