Change subject line so it shows the name of the site.
[cocanwiki.git] / scripts / page_email_unsubscribe.ml
index 55749c4..0f75d86 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: page_email_unsubscribe.ml,v 1.2 2005/11/24 14:54:12 rich Exp $
+ * $Id: page_email_unsubscribe.ml,v 1.4 2006/03/28 16:24:08 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
@@ -27,15 +27,14 @@ open Printf
 open Cocanwiki
 open Cocanwiki_ok
 
-let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
+let run r (q : cgi) dbh hostid _ _ =
   let opt_out = q#param "o" in
 
   (* Update the database. *)
-  let sth = dbh#prepare_cached "delete from page_emails
-                                 where hostid = ? and opt_out = ?" in
-  sth#execute [`Int hostid; `String opt_out];
+  PGSQL(dbh)
+    "delete from page_emails where hostid = $hostid and opt_out = $opt_out";
 
-  dbh#commit ();
+  PGOCaml.commit dbh;
 
   (* Confirmed. *)
   let buttons = [ ok_button "/" ] in