About half way through switching cocanwiki to using the new PG interface.
[cocanwiki.git] / scripts / edit_host_settings.ml
index b9cd2c1..e8bbebf 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_host_settings.ml,v 1.7 2004/11/03 13:36:45 rich Exp $
+ * $Id: edit_host_settings.ml,v 1.9 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
@@ -48,6 +48,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
   let brand = trim (q#param "brand") in
   let brand_tagline = trim (q#param "brand_tagline") in
   let brand_description = trim (q#param "brand_description") in
+  let pagebug = trim (q#param "pagebug") in
 
   let theme_css = if theme_css = "" then `Null else `String theme_css in
   let feedback_email =
@@ -57,6 +58,8 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
     if brand_tagline = "" then `Null else `String brand_tagline in
   let brand_description =
     if brand_description = "" then `Null else `String brand_description in
+  let pagebug =
+    if pagebug = "" then `Null else `String pagebug in
 
   (* Update the database. *)
   let sth = dbh#prepare_cached "update hosts set edit_anon = ?,
@@ -65,12 +68,14 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
                                   search_box = ?, navigation = ?,
                                   view_anon = ?,
                                   brand = ?, brand_tagline = ?,
-                                  brand_description = ?
+                                  brand_description = ?,
+                                  pagebug = ?
                                 where id = ?" in
   sth#execute [`Bool edit_anon; `Bool create_account_anon;
               theme_css; feedback_email; `Bool mailing_list; `Bool search_box;
               `Bool navigation; `Bool view_anon;
               brand; brand_tagline; brand_description;
+              pagebug;
               `Int hostid];
 
   dbh#commit ();
@@ -78,7 +83,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
   (* Finish off. *)
   ok ~title:"Global settings updated"
     ~buttons:[ok_button "/_bin/host_menu.cmo"]
-    q "The global settings were updated."
+    dbh hostid q "The global settings were updated."
 
 let () =
   register_script ~restrict:[CanManageSite] run