^(C.stringToSql email), ^(C.boolToSql forward), ^(C.stringToSql uses),
^(C.stringToSql other), ^(C.stringToSql passwd), 0, CURRENT_TIMESTAMP,
'', ^(C.stringToSql unix_passwd))`);
- sendMail (email, "Confirm membership application",
+ if sendMail (email, "Confirm membership application",
"We've received a request to join the Internet Hosting Cooperative (hcoop.net) with this e-mail address.",
fn mwrite => (mwrite ("To confirm this application, visit ");
mwrite (baseUrl);
mwrite ("&p=");
mwrite passwd;
mwrite ("\n")),
- id)
+ id) then
+ SOME unix_passwd
+ else
+ NONE
end
| _ => raise Fail "Bad next sequence val"
end
val db = getDb ()
in
case C.oneOrNoRows db ($`SELECT unix_passwd FROM MemberApp WHERE id = ^(C.intToSql id) AND passwd = ^(C.stringToSql passwd) AND status = 0`) of
- SOME [unix_passwd] =>
+ SOME [_] =>
(C.dml db ($`UPDATE MemberApp SET status = 1, confirmed = CURRENT_TIMESTAMP WHERE id = ^(C.intToSql id)`);
- if sendMail ("board@hcoop.net",
- "New membership application",
- "We've received a new request to join hcoop.",
- fn mwrite => (mwrite ("Open applications: ");
- mwrite (portalUrl);
- mwrite ("apps")),
- id) then
- SOME (C.stringFromSql unix_passwd)
- else
- NONE)
- | NONE => NONE
+ sendMail ("board@hcoop.net",
+ "New membership application",
+ "We've received a new request to join hcoop.",
+ fn mwrite => (mwrite ("Open applications: ");
+ mwrite (portalUrl);
+ mwrite ("apps")),
+ id))
+ | NONE => false
end
end