X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fmailing_list_send.ml;h=5974e13e553382d246b08ef6fdb8a80c3e15a6b2;hb=3f0bcc30ff112dc38e882f4f08b8c37d693799ef;hp=6fcbfcc61df0eb350df75eb7741981adaa3debf4;hpb=799d629c5af725596497b7df2055db6ac6da91b7;p=cocanwiki.git diff --git a/scripts/mailing_list_send.ml b/scripts/mailing_list_send.ml index 6fcbfcc..5974e13 100644 --- a/scripts/mailing_list_send.ml +++ b/scripts/mailing_list_send.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -33,6 +33,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = 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 @@ -72,9 +73,10 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = 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 (); @@ -95,4 +97,4 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = "first link in that email to confirm.") let () = - register_script run + register_script ~restrict:[CanView] run