New member applications
[hcoop/zz_old/portal.git] / app / join.mlt
diff --git a/app/join.mlt b/app/join.mlt
new file mode 100644 (file)
index 0000000..bfbfe28
--- /dev/null
@@ -0,0 +1,52 @@
+<% @header [("title", ["Apply for membership"])] %>
+
+<% if $"cmd" = "app" then
+       val name = $"name";
+       val rname = $"rname";
+       val email = $"email";
+       val forward = $"forward" <> "on";
+       val uses = $"uses";
+       val other = $"other";
+
+       if name = "" then
+               %><h3><b>Please enter a username</b></h3><%
+       elseif rname = "" then
+               %><h3><b>Please enter your name</b></h3><%
+       elseif email = "" then
+               %><h3><b>Please enter your contact e-mail address</b></h3><%
+       elseif uses = "" then
+               %><h3><b>Please enter your proposed uses</b></h3><%
+       elseif not (App.validUser name) then
+               %><h3><b>Invalid requested username</b></h3><%
+       elseif App.userExists name then
+               %><h3><b>That username is already in use.</b><h3><%
+       elseif not (App.validEmail email) then
+               %><h3><b>Invalid e-mail address</b></h3><%
+       elseif not (App.apply { name = name, rname = rname, email = email,
+                               forward = forward, uses = uses, other = other }) then
+               %><h3><b>Error sending confirmation e-mail</b></h3><%
+       else
+               %><h3><b>Application recorded</b></h3>
+               Check your e-mail for a message with further instructions.<%
+       end
+else %>
+
+<form action="join" method="post">
+<input type="hidden" name="cmd" value="app">
+<table>
+<tr> <td align="right" valign="top"><b>Desired username</b>:</td> <td><input name="name"><br>
+       You should follow usual UNIX conventions, and it's helpful to pick a name you wouldn't mind using to identify yourself to strangers.</td> </tr>
+<tr> <td align="right"><b>Your "real" name</b>:</td> <td><input name="rname"></td> </tr>
+<tr> <td align="right"><b>Contact e-mail address</b></td> <td><input name="email"></td> </tr>
+<tr> <td align="right" valign="top"><input type="checkbox" name="forward"></td> <td>Check this box if you would like to use hcoop as your primary e-mail provider.<br>
+       If you don't select this option and you are approved to join, e-mail to your account will be forwarded to the address you provide here.<br>
+       You can change this option later, but we'll probably have helpul 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>
+<tr> <td align="right" valign="top"><b>How do you plan to use a hcoop membership?</b></td> <td><textarea name="uses" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
+<tr> <td align="right" valign="top"><b>Any other information about yourself</b></td> <td><textarea name="other" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
+<tr> <td><input type="submit" value="Apply"></td> </tr>
+</table>
+</form>
+
+<% end %>
+
+<% @footer[] %>
\ No newline at end of file