val approve : int * string -> bool
val add : int -> unit
val abortAdd : int -> unit
+ val welcome : int -> unit
end
end
fun add app =
- ignore (C.dml (getDb ()) ($`UPDATE MemberApp
- SET status = 3
- WHERE id = ^(C.intToSql app)`))
+ let
+ val _ = C.dml (getDb ()) ($`UPDATE MemberApp
+ SET status = 3
+ WHERE id = ^(C.intToSql app)`)
+
+ val app = lookupApp app
+
+ val outf = TextIO.openOut (Config.passwordFiles ^ #name app)
+ in
+ TextIO.output (outf, #unix_passwd app);
+ TextIO.closeOut outf
+ end
+
+fun welcome app =
+ let
+ val app = lookupApp app
+
+ val mail = Mail.mopen ()
+ in
+ Mail.mwrite (mail, "To: ");
+ Mail.mwrite (mail, #email app);
+ Mail.mwrite (mail, "\n");
+ Mail.mwrite (mail, Util.readFile "/home/hcoop/portal/paid.txt");
+ ignore (Mail.mclose mail)
+ end
fun abortAdd app =
ignore (C.dml (getDb ()) ($`UPDATE MemberApp
val appl = App.lookupApp id;
App.add id %>
-First, create this UNIX user:
-<blockquote><tt>portal_adduser <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %></tt></blockquote>
-
-<p>You should then run <tt>visudo</tt> to add <% #name appl %> to the <tt>MEMBERS</tt> group. If you're not transmitting <% #name appl %>'s password to him by other means, run <tt>savepass <% #name appl %> <password></tt> to save it in <tt>~<% #name appl %>/.pass</tt>. If <% #name appl %> is bootstrapping with public-key ssh, don't forget to run <tt>savekey <% #name appl %> <authorized_keys file location></tt>.</p>
+First, run this on deleuze:
+<blockquote><tt>magic-create-user-wrapper <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %></tt></blockquote>
<form action="users" method="post">
<input type="hidden" name="app" value="<% #id appl %>">
val boardEmail : string
val dbstring : string
val kerberosSuffix : string
+val passwordFiles : string
end
val dbstring = "dbname='hcoop_hcoop' user='www-data'"
val kerberosSuffix = "@HCOOP.NET"
+
+val passwordFiles = "/var/lib/portal/"
end
--- /dev/null
+Bcc: payment@hcoop.net
+Subject: Your HCoop account has been created!
+From: HCoop Board of Directors <board@hcoop.net>
+
+Your new account at hcoop.net has been created.
+
+You should now read this wiki page, which contains important information for new
+members and describes how you can start using your account:
+ http://wiki2.hcoop.net/MemberManual/GettingStarted/AccountCreated
+
+It's a good idea to read it all the way through before proceeding.
if not (Pref.subscribe ("hcoop-announce", $"name" ^ Init.emailSuffix)) then
%><h3>Error subscribing to hcoop-announce</h3><%
end
- end %>
- <h3>Member added</h3>
+ end;
+
+ if $"nomail" = "" then
+ App.welcome ap
+ end
+
+ %><h3>Member added</h3>
<% end
end
elseif $"mod" <> "" then
Subject: Welcome to HCoop!
From: HCoop Board of Directors <board@hcoop.net>
-The HCoop Board of Directors has voted to accept your membership application. Welcome to our family! :-)
+The HCoop Board of Directors has voted to accept your membership application.
+Welcome to our family! :-)
-You should now read this wiki page, which describes how we can complete your joining process:
- http://wiki.hcoop.net/wiki/NewMember
+You should now read this wiki page, which describes how we can complete your
+joining process:
+ http://wiki2.hcoop.net/MemberManual/GettingStarted/NewMember
-It's a good idea to read it all the way through and then follow the instructions on payment and account creation.
+It's a good idea to read it all the way through and then follow the instructions
+on payment and account creation.