X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fcreate_contact.ml;h=61eebebc7c6579f54443c6a47b77bf40605e0347;hb=295f2cde3f43ccf7f775d39b95925e10aa4c37cb;hp=85cb4c1c351414a4fe0d98ad29982c75e5c3e129;hpb=8c4a3ed306ab6afd228050c31c65344fe0fc1f46;p=cocanwiki.git diff --git a/scripts/create_contact.ml b/scripts/create_contact.ml index 85cb4c1..61eebeb 100644 --- a/scripts/create_contact.ml +++ b/scripts/create_contact.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: create_contact.ml,v 1.1 2004/09/21 15:55:48 rich Exp $ + * $Id: create_contact.ml,v 1.3 2005/03/31 14:24:04 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 @@ -42,20 +42,20 @@ 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."; - raise CgiExit + return () ); if subject = "" then ( error ~back_button:true ~title:"Subject line missing" q "You must give a subject line, which appears on contact emails."; - raise CgiExit + 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."); - raise CgiExit + return () ); (* Update the database. *) @@ -75,10 +75,11 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = let msg = sprintf "Contact form created. The contact id is %d. On the next page you will be given some same code which you should copy and paste onto a web page to create a simple form, which can then be modified for your requirements." contactid in - let buttons = [ { StdPages.label = " View contact form "; - StdPages.link = "/_bin/contact_show.cmo"; - StdPages.method_ = None; - StdPages.params = [ "id", string_of_int contactid ] } ] in + let buttons = [ { Template.StdPages.label = " View contact form "; + Template.StdPages.link = "/_bin/contact_show.cmo"; + Template.StdPages.method_ = None; + Template.StdPages.params = + [ "id", string_of_int contactid ] } ] in ok ~title:"Contact form created" ~buttons q msg let () =