% @header [("title", ["Apply for membership"])] %>
<% if $"cmd" = "app" then
val minor = $"minor" <> "";
val name = $"name";
val rname = $"rname";
val gname = $"gname";
val email = $"email";
val forward = $"forward" <> "on";
val uses = $"uses";
val other = $"other";
if $"agree" <> "on" then
%>
You must accept the Terms of Service!
<%
elseif name = "" then
%>
Please enter a username
<%
elseif rname = "" then
%>
Please enter the potential member's name
<%
elseif (iff minor then gname = "" else false) then
%>
Please enter your name, as legal guardian
<%
elseif email = "" then
%>
Please enter your contact e-mail address
<%
elseif uses = "" then
%>
Please enter your proposed uses
<%
elseif not (App.validUsername name) then
%>
Invalid requested username
<%
elseif App.userExists name then
%>
That username is already in use.
<%
elseif not (App.validEmail email) then
%>
Invalid e-mail address
<%
else switch App.apply { name = name, rname = rname, email = email,
gname = (case gname of "" => NONE | _ => SOME gname),
forward = forward, uses = uses, other = other,
paypal = (case $"paypal" of "" => NONE | s => SOME s),
checkout = (case $"checkout" of "" => NONE | s => SOME s) } of
NONE => %>
Error sending confirmation e-mail
<%
| SOME unix_passwd =>
%>
Application recorded
Check your e-mail for a message with further instructions.
Save this password to use to access your new account if your application is approved:
<% Web.html unix_passwd %>
If you don't receive a confirmation e-mail message, then something is wrong, and don't expect any further progress to be made on your application unless you contact admins@hcoop.net describing the problem. Before doing so, make sure our confirmation message didn't end up filtered as "spam."
<% end
end
else
val minor = $"minor" <> "" %>
<% end %>
<% @footer[] %>