More thorough inclusion of the page bug. This should mean the page bug appears just...
[cocanwiki.git] / scripts / edit_contact.ml
index 8fe5551..46002f9 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: edit_contact.ml,v 1.3 2005/03/31 14:24:04 rich Exp $
+ * $Id: edit_contact.ml,v 1.4 2005/11/24 14:54:11 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
@@ -44,20 +44,22 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
 
   if name = "" then (
     error ~back_button:true ~title:"Name field missing"
-      q "You must name your contact form.";
+      dbh hostid q "You must name your contact form.";
     return ()
   );
 
   if subject = "" then (
     error ~back_button:true ~title:"Subject line missing"
-      q "You must give a subject line, which appears on contact emails.";
+      dbh hostid q
+      "You must give a subject line, which appears on contact emails.";
     return ()
   );
 
   if emails = [] then (
     error ~back_button:true ~title:"No email addresses"
-      q ("There are no email addresses listed for this contact form.  You " ^
-        "must list at least one valid email address.");
+      dbh hostid q
+      ("There are no email addresses listed for this contact form.  You " ^
+       "must list at least one valid email address.");
     return ()
   );
 
@@ -92,7 +94,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
       Template.StdPages.method_ = None;
       Template.StdPages.params = [ "id", string_of_int id ] } ] in
   ok ~title:"Contact form edited" ~buttons
-    q "The contact form was edited."
+    dbh hostid q "The contact form was edited."
 
 let () =
   register_script ~restrict:[CanManageContacts] run