X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fedit_host_settings.ml;h=b9cd2c1679cb460ad530a8cb3fc53559dbf112fe;hb=89e8d5757ca111d16ce3dfcc1ce4f2c00a119c85;hp=fd85e175be4121e4d1aad2083bf48659ee8bb9d3;hpb=df32ab1d0dd164b73cfa9607797eaf85e0a0154d;p=cocanwiki.git diff --git a/scripts/edit_host_settings.ml b/scripts/edit_host_settings.ml index fd85e17..b9cd2c1 100644 --- a/scripts/edit_host_settings.ml +++ b/scripts/edit_host_settings.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit_host_settings.ml,v 1.4 2004/09/27 16:21:09 rich Exp $ + * $Id: edit_host_settings.ml,v 1.7 2004/11/03 13:36:45 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 @@ -26,6 +26,7 @@ open Printf open Cocanwiki open Cocanwiki_ok +open Cocanwiki_strings let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = (* Cancel? *) @@ -39,22 +40,37 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ = let edit_anon = q#param_true "edit_anon" in let create_account_anon = q#param_true "create_account_anon" in let theme_css = q#param "theme_css" in - let feedback_email = q#param "feedback_email" in + let feedback_email = trim (q#param "feedback_email") in let mailing_list = q#param_true "mailing_list" in let search_box = q#param_true "search_box" in + let navigation = q#param_true "navigation" in + let view_anon = q#param_true "view_anon" in + 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 theme_css = if theme_css = "" then `Null else `String theme_css in let feedback_email = if feedback_email = "" then `Null else `String feedback_email in + let brand = if brand = "" then `Null else `String brand in + let brand_tagline = + if brand_tagline = "" then `Null else `String brand_tagline in + let brand_description = + if brand_description = "" then `Null else `String brand_description in (* Update the database. *) let sth = dbh#prepare_cached "update hosts set edit_anon = ?, create_account_anon = ?, theme_css = ?, feedback_email = ?, mailing_list = ?, - search_box = ? + search_box = ?, navigation = ?, + view_anon = ?, + brand = ?, brand_tagline = ?, + brand_description = ? 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; `Int hostid]; dbh#commit ();