From cee714e26f7f0b852ff5fae23f9a39718ad22200 Mon Sep 17 00:00:00 2001 From: adamch Date: Sun, 18 Nov 2007 23:03:07 +0000 Subject: [PATCH] Application pipeline seems to be working --- app.sig | 1 + app.sml | 28 +++++++++++++++++++++++++--- apps.mlt | 6 ++---- config.sig | 1 + config.sml | 2 ++ paid.txt | 11 +++++++++++ users.mlt | 9 +++++++-- welcome.txt | 11 +++++++---- 8 files changed, 56 insertions(+), 13 deletions(-) create mode 100644 paid.txt diff --git a/app.sig b/app.sig index 3842d29..00cc343 100644 --- a/app.sig +++ b/app.sig @@ -29,4 +29,5 @@ sig val approve : int * string -> bool val add : int -> unit val abortAdd : int -> unit + val welcome : int -> unit end diff --git a/app.sml b/app.sml index 15727a6..93a94eb 100644 --- a/app.sml +++ b/app.sml @@ -114,9 +114,31 @@ fun approve (app, msg) = 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 diff --git a/apps.mlt b/apps.mlt index af6e1bf..395beca 100644 --- a/apps.mlt +++ b/apps.mlt @@ -87,10 +87,8 @@ elseif $"add" <> "" then val appl = App.lookupApp id; App.add id %> -First, create this UNIX user: -
portal_adduser <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %>
- -

You should then run visudo to add <% #name appl %> to the MEMBERS group. If you're not transmitting <% #name appl %>'s password to him by other means, run savepass <% #name appl %> <password> to save it in ~<% #name appl %>/.pass. If <% #name appl %> is bootstrapping with public-key ssh, don't forget to run savekey <% #name appl %> <authorized_keys file location>.

+First, run this on deleuze: +
magic-create-user-wrapper <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %>
diff --git a/config.sig b/config.sig index d3ca805..22145f9 100644 --- a/config.sig +++ b/config.sig @@ -6,5 +6,6 @@ val emailSuffix : string val boardEmail : string val dbstring : string val kerberosSuffix : string +val passwordFiles : string end diff --git a/config.sml b/config.sml index ab7cfec..b8c441a 100644 --- a/config.sml +++ b/config.sml @@ -8,5 +8,7 @@ val boardEmail = "board" ^ emailSuffix val dbstring = "dbname='hcoop_hcoop' user='www-data'" val kerberosSuffix = "@HCOOP.NET" + +val passwordFiles = "/var/lib/portal/" end diff --git a/paid.txt b/paid.txt new file mode 100644 index 0000000..2b5cace --- /dev/null +++ b/paid.txt @@ -0,0 +1,11 @@ +Bcc: payment@hcoop.net +Subject: Your HCoop account has been created! +From: HCoop Board of Directors + +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. diff --git a/users.mlt b/users.mlt index 1cd37f0..1a3201c 100644 --- a/users.mlt +++ b/users.mlt @@ -31,8 +31,13 @@ if $"cmd" = "Create" then if not (Pref.subscribe ("hcoop-announce", $"name" ^ Init.emailSuffix)) then %>

Error subscribing to hcoop-announce

<% end - end %> -

Member added

+ end; + + if $"nomail" = "" then + App.welcome ap + end + + %>

Member added

<% end end elseif $"mod" <> "" then diff --git a/welcome.txt b/welcome.txt index 47aa515..feabf14 100644 --- a/welcome.txt +++ b/welcome.txt @@ -1,9 +1,12 @@ Subject: Welcome to HCoop! From: HCoop Board of Directors -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. -- 2.20.1