X-Git-Url: http://git.hcoop.net/hcoop/portal.git/blobdiff_plain/96bd398ee746f9f2975bc06b24fcbe7e430164fb..47ea7c948ab73a626681f1f75f42a67921c0ca9f:/app.sml diff --git a/app.sml b/app.sml index 6d603ea..98b8c75 100644 --- a/app.sml +++ b/app.sml @@ -114,29 +114,29 @@ fun approve (app, msg) = Mail.mwrite (mail, "To: "); Mail.mwrite (mail, #email entry); Mail.mwrite (mail, "\n"); - Mail.mwrite (mail, Util.readFile "/home/hcoop/portal/welcome.txt"); + Mail.mwrite (mail, Util.readFile (Config.staticFilesRoot ^ "welcome.txt")); Mail.mwrite (mail, msg); OS.Process.isSuccess (Mail.mclose mail) end fun preAdd app = - ignore (C.dml (getDb ()) ($`UPDATE MemberApp - SET status = 5 - WHERE id = ^(C.intToSql app)`)) - -fun add app = let val _ = C.dml (getDb ()) ($`UPDATE MemberApp - SET status = 4 + SET status = 5 WHERE id = ^(C.intToSql app)`) val app = lookupApp app + in + () + end - val outf = TextIO.openOut (Config.passwordFiles ^ #name app) +fun add app = + let + val appR = lookupApp app in - TextIO.output (outf, #unix_passwd app); - TextIO.output1 (outf, #"\n"); - TextIO.closeOut outf + ignore (C.dml (getDb ()) ($`UPDATE MemberApp + SET status = 4 + WHERE id = ^(C.intToSql app)`)) end fun welcome app = @@ -148,7 +148,7 @@ fun welcome app = Mail.mwrite (mail, "To: "); Mail.mwrite (mail, #email app); Mail.mwrite (mail, "\n"); - Mail.mwrite (mail, Util.readFile "/home/hcoop/portal/paid.txt"); + Mail.mwrite (mail, Util.readFile (Config.staticFilesRoot ^ "paid.txt")); ignore (Mail.mclose mail) end @@ -170,9 +170,9 @@ fun readFile fname = before TextIO.closeIn inf end -fun readTosBody () = readFile "/home/hcoop/public_html/tos.body.html" -fun readTosAgree () = readFile "/home/hcoop/public_html/tos.agree.html" -fun readTosMinorAgree () = readFile "/home/hcoop/public_html/tos.agree.minor.html" +fun readTosBody () = readFile (Config.staticFilesRoot ^ "tos.body.html") +fun readTosAgree () = readFile (Config.staticFilesRoot ^ "tos.agree.html") +fun readTosMinorAgree () = readFile (Config.staticFilesRoot ^ "tos.agree.minor.html") fun searchPaypal paypal = C.map (getDb ()) mkAppRow ($`SELECT id, name, rname, gname, email, forward, uses, other, passwd, status, applied, ipaddr, confirmed, decided,