(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mailing_list_send.ml,v 1.2 2004/09/24 16:45:02 rich Exp $
+ * $Id: mailing_list_send.ml,v 1.4 2004/10/04 15:19:56 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
let template = get_template dbh hostid "mailing_list_send.txt" in
let email = trim (q#param "email") in
+ let name = trim (q#param "name") in
if email = "" then (
error ~title:"No email address" ~back_button:true
let opt_out = random_sessionid () in
(* Insert into the database. *)
- let sth = dbh#prepare_cached "insert into mailing_lists (hostid, email,
- pending, opt_out) values (?, ?, ?, ?)" in
- sth#execute [`Int hostid; `String email; `String pending; `String opt_out];
+ let sth = dbh#prepare_cached "insert into mailing_lists (hostid, email, name,
+ pending, opt_out) values (?, ?, ?, ?, ?)" in
+ sth#execute [`Int hostid; `String email; `String name;
+ `String pending; `String opt_out];
dbh#commit ();
"first link in that email to confirm.")
let () =
- register_script run
+ register_script ~restrict:[CanView] run