val mail = Mail.mopen ()
in
- Mail.mwrite (mail, "From: Hcoop Application System <join@hcoop.net>\nTo: ");
+ Mail.mwrite (mail, "From: Hcoop Application System <join");
+ Mail.mwrite (mail, emailSuffix);
+ Mail.mwrite (mail, ">\nTo: ");
Mail.mwrite (mail, #email entry);
Mail.mwrite (mail, "\nCc: ");
Mail.mwrite (mail, boardEmail);
val mail = Mail.mopen ()
in
- Mail.mwrite (mail, "From: Hcoop Application System <join@hcoop.net>\nTo: ");
+ Mail.mwrite (mail, "From: Hcoop Application System <join");
+ Mail.mwrite (mail, emailSuffix);
+ Mail.mwrite (mail, ">\nTo: ");
Mail.mwrite (mail, #email entry);
Mail.mwrite (mail, "\nCc: ");
Mail.mwrite (mail, boardEmail);
fun readTosAgree () = readFile "/var/www/home/html/tos.agree.html"
fun readTosMinorAgree () = readFile "/var/www/home/html/tos.agree.minor.html"
-end
\ No newline at end of file
+end
let
val _ = Unix.reap proc
- val proc = Unix.execute ("/usr/bin/dpkg", ["-l", name])
- val inf = Unix.textInstreamOf proc
- val installed =
- case TextIO.inputLine inf of
- NONE => false
- | SOME line => String.sub (line, 0) = #"D"
-
- val _ = Unix.reap proc
+ val installed = OS.Process.isSuccess (OS.Process.system ("/usr/bin/dpkg -p " ^ name ^ " >/dev/null 2>/dev/null"))
in
SOME {name = name, section = section, descr = descr, installed = installed}
end
NONE)
end
-end
\ No newline at end of file
+end
exception Access of string
exception NeedTos
+ val emailSuffix : string
+
type user = {id : int, name : string, rname : string, bal : int, joined : C.timestamp,
app : int}
val dateString : unit -> string
val grandfatherUsers : unit -> unit
-end
\ No newline at end of file
+end
exception Access of string
exception NeedTos
-val urlPrefix = "http://users.hcoop.net/portal/"
-val boardEmail = "board.fake@hcoop.net"
+val urlPrefix = "https://members.hcoop.net/portal/"
+val emailSuffix = "@new.hcoop.net"
+val boardEmail = "board" ^ emailSuffix
-fun conn () = C.conn "dbname='hcoop'"
+fun conn () = C.conn "dbname='hcoop_hcoop'"
val close = C.close
type user = {id : int, name : string, rname : string, bal : int, joined : C.timestamp,
ignore (C.dml db ($`INSERT INTO MemberApp (id, name, rname, gname, email, forward, uses, other,
passwd, status, applied, confirmed, decided, msg)
VALUES (^(C.intToSql aid), ^(C.stringToSql name), ^(C.stringToSql rname),
- NULL, '^name@hcoop.net', FALSE, 'GRANDFATHERED', 'GRANDFATHERED',
+ NULL, '^name^(emailSuffix)', FALSE, 'GRANDFATHERED', 'GRANDFATHERED',
'GRANDFATHERED', 4, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP, 'GRANDFATHERED')`));
ignore (C.dml db ($`UPDATE WebUser SET app = ^(C.intToSql aid) WHERE id = ^(C.intToSql id)`))
in
C.app db mkApp "SELECT id, name, rname FROM WebUser WHERE app IS NULL"
end
-end
\ No newline at end of file
+end
val votes = Web.stoi ($"votes");
if title = "" then
%><h3><b>Your poll must have a title.</b></h3><%
- elseif not (Poll.dateGeNow starts) then
+ elseif not pollAdmin and not (Poll.dateGeNow starts) then
%><h3><b>That start date is in the past!</b></h3><%
- elseif not (Poll.dateLe (starts, ends)) then
+ elseif not pollAdmin and not (Poll.dateLe (starts, ends)) then
%><h3><b>The end date comes before the start date!</b></h3><%
elseif votes <= 0 then
%><h3><b>You must specify a positive number of votes per person.</b></h3><%
val votes = Web.stoi ($"votes");
if title = "" then
%><h3><b>Your poll must have a title.</b></h3><%
- elseif not (Poll.dateGeNow starts) then
+ elseif not pollAdmin and not (Poll.dateGeNow starts) then
%><h3><b>That start date is in the past!</b></h3><%
- elseif not (Poll.dateLe (starts, ends)) then
+ elseif not pollAdmin and not (Poll.dateLe (starts, ends)) then
%><h3><b>The end date comes before the start date!</b></h3><%
elseif votes <= 0 then
%><h3><b>You must specify a positive number of votes per person.</b></h3><%
end
| doOne r = rowError (table ^ ".doOne", r)
in
- Mail.mwrite (mail, "From: Hcoop Portal <portal@hcoop.net>\nTo: ");
+ Mail.mwrite (mail, "From: Hcoop Portal <portal");
+ Mail.mwrite (mail, emailSuffix);
+ Mail.mwrite (mail, ">\nTo: ");
Mail.mwrite (mail, #name user);
- Mail.mwrite (mail, "@hcoop.net\n");
- Mail.mwrite (mail, "Bcc: ");
+ Mail.mwrite (mail, emailSuffix);
+ Mail.mwrite (mail, "\nBcc: ");
C.app (getDb ()) doOne ($`SELECT name
FROM WebUser JOIN Membership ON (usr = id AND grp = ^(C.intToSql grp))`);
Mail.mwrite (mail, "\nSubject: ");
Mail.mwrite (mail, statusToString newStatus);
Mail.mwrite (mail, ".\n\n"))) req
-end
\ No newline at end of file
+end
structure NM = BinaryMapFn(IntKey)
-val outputDir = "/var/www/home/html/dyn/"
+val outputDir = "/var/www/dyn/"
fun generate () =
let
- val db = C.conn "dbname='hcoop'"
+ val db = C.conn "dbname='hcoop_hcoop'"
fun header (outf, title) =
(TextIO.output (outf, "<html><head>\n<title>");
List.app (fn s => print (s ^ "\n")) (SMLofNJ.exnHistory ex);
OS.Process.failure)
-end
\ No newline at end of file
+end
val mail = Mail.mopen ()
in
- Mail.mwrite (mail, "From: Hcoop Support System <support@hcoop.net>\nTo: ");
+ Mail.mwrite (mail, "From: Hcoop Support System <support");
+ Mail.mwrite (mail, emailSuffix);
+ Mail.mwrite (mail, ">\nTo: ");
Mail.mwrite (mail, #name user);
- Mail.mwrite (mail, "@hcoop.net\n");
+ Mail.mwrite (mail, emailSuffix);
+ Mail.mwrite (mail, "\n");
writeRecipients (mail, iss, cat, #name user);
Mail.mwrite (mail, "Subject: ");
Mail.mwrite (mail, prefix);
Mail.mwrite (mail, ".\n"))) iss
end
-end
\ No newline at end of file
+end