Join script should rule out retired usernames
[bpt/portal.git] / app / join.mlt
1 <% @header [("title", ["Apply for membership"])] %>
2
3 <% if $"cmd" = "app" then
4 val minor = $"minor" <> "";
5 val name = $"name";
6 val rname = $"rname";
7 val gname = $"gname";
8 val email = $"email";
9 val forward = $"forward" <> "on";
10 val uses = $"uses";
11 val other = $"other";
12
13 if $"agree" <> "on" then
14 %><h3>You must accept the Terms of Service!</h3><%
15 elseif name = "" then
16 %><h3>Please enter a username</h3><%
17 elseif rname = "" then
18 %><h3>Please enter the potential member's name</h3><%
19 elseif (iff minor then gname = "" else false) then
20 %><h3>Please enter your name, as legal guardian<b></h3><%
21 elseif email = "" then
22 %><h3>Please enter your contact e-mail address</h3><%
23 elseif uses = "" then
24 %><h3>Please enter your proposed uses</h3><%
25 elseif not (App.validUsername name) then
26 %><h3>Invalid requested username</h3><%
27 elseif App.userExists name then
28 %><h3>That username is already in use.</b><h3><%
29 elseif not (App.validEmail email) then
30 %><h3>Invalid e-mail address</h3><%
31 else switch App.apply { name = name, rname = rname, email = email,
32 gname = (case gname of "" => NONE | _ => SOME gname),
33 forward = forward, uses = uses, other = other,
34 paypal = (case $"paypal" of "" => NONE | s => SOME s),
35 checkout = (case $"checkout" of "" => NONE | s => SOME s) } of
36 NONE => %><h3>Error sending confirmation e-mail</h3><%
37 | SOME unix_passwd =>
38 %><h3>Application recorded</h3>
39 Check your e-mail for a message with further instructions. <h1>Save this password to use to access your new account if your application is approved:</h1>
40 <blockquote><tt><% Web.html unix_passwd %></tt></blockquote>
41 <p><b>If you don't receive a confirmation e-mail message</b>, then something is wrong, and don't expect any further progress to be made on your application unless you contact <a href="mailto:admins@hcoop.net">admins@hcoop.net</a> describing the problem. Before doing so, make sure our confirmation message didn't end up filtered as "spam."</p>
42 <% end
43 end
44 else
45 val minor = $"minor" <> "" %>
46
47 <form action="join" method="post">
48 <input type="hidden" name="cmd" value="app">
49 <table class="blanks">
50 <tr> <td width="25%">Desired username:</td> <td width="75%"><input name="name"><br>
51 Please follow usual UNIX conventions, including limiting yourself to lowercase letters and at most 8 characters. It's helpful to pick a name you wouldn't mind using to identify yourself to both strangers and friends. Something based on your "real" name is a safe bet.<br>
52 You don't need to worry about whether or not the username you want is already taken. This application system will let you know if that is the case. You can probably use a shorter and simpler name than you are accustomed to getting at larger services, so we encourage you to try such names first.</td> </tr>
53 <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
54 <% if minor then %>
55 <tr> <td>New member's "real" name:</td> <td><input name="rname" size="50"></td> </tr>
56 <tr> <td>Legal guardian's name:</td> <td><input name="gname"><br> Please enter your full name, as you would on a normal, legally binding contract.</td></tr>
57 <% else %>
58 <tr> <td>Your "real" name:</td> <td><input name="rname"><br> Please enter your full name, as you would on a normal, legally binding contract.</td></tr>
59 <% end %>
60 <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
61 <tr> <td>Contact e-mail address</td> <td><input name="email" size="50"></td> </tr>
62 <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
63 <tr> <td><a href="http://www.paypal.com/">PayPal</a> account e-mail:</td> <td><input name="paypal" size="50"></td> </tr>
64 <tr> <td><a href="http://checkout.google.com/">Google Checkout</a> account e-mail:</td> <td><input name="checkout" size="50"><br>
65 These payment service provider e-mail addresses are optional. You will probably end up using one or the other of these providers if your application is approved, and entering here the e-mail address that you've used to sign up with that provider will help us process your payment accurately and promptly. E-mail addresses you enter here should match those seen by recipients of payments that you send.</td> </tr>
66 <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
67 <tr> <td><input type="checkbox" name="forward"></td> <td>Check this box if you would like to use HCoop as your primary e-mail provider.<br>
68 If you don't select this option and you are approved to join, e-mail to your HCoop account will be forwarded to the contact address you provided above (without preserving a local copy on HCoop servers).<br>
69 You can change this option later, but we'll probably have helpful things to e-mail you as soon as you join. It's important that we be able to reach members reliably, so please don't decide to use us as your primary e-mail provider unless you can commit to checking your HCoop mailbox just as often as any other personal accounts you have.</td> </tr>
70 <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
71 <tr> <td>How do you plan to use a HCoop membership?</td> <td><textarea name="uses" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
72 <tr> <td>Any other information about yourself</td> <td><textarea name="other" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
73 </table>
74
75 <br><hr><br>
76
77 You must agree to the following terms to be considered for membership:
78
79 <h2><b>Terms of Service Agreement</b></h2>
80
81 <% App.readTosBody () %>
82
83 <br><hr><br>
84
85 <input type="checkbox" name="agree">
86 <% if minor then App.readTosMinorAgree () else App.readTosAgree () end %>
87
88 <br><br><input type="submit" value="Apply">
89
90 </form>
91
92 <% end %>
93
94 <% @footer[] %>