Global replace 'raise CgiExit' -> 'return ()' to match a future version of mod_caml.
authorrich <rich>
Thu, 23 Sep 2004 11:56:47 +0000 (11:56 +0000)
committerrich <rich>
Thu, 23 Sep 2004 11:56:47 +0000 (11:56 +0000)
25 files changed:
scripts/admin/edit_emails.ml
scripts/admin/edit_hostnames.ml
scripts/cocanwiki.ml
scripts/contact.ml
scripts/create.ml
scripts/create_contact.ml
scripts/create_form.ml
scripts/create_user.ml
scripts/delete_contact.ml
scripts/delete_contact_form.ml
scripts/delete_user.ml
scripts/delete_user_form.ml
scripts/edit.ml
scripts/edit_contact.ml
scripts/edit_host_settings.ml
scripts/edit_sitemenu.ml
scripts/edit_user.ml
scripts/forgot_password.ml
scripts/page.ml
scripts/restore_form.ml
scripts/send_feedback.ml
scripts/set_password.ml
scripts/signup.ml
scripts/upload_file.ml
scripts/upload_image.ml

index 7948c51..a1d0cc6 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_emails.ml,v 1.5 2004/09/09 12:21:22 rich Exp $
+ * $Id: edit_emails.ml,v 1.6 2004/09/23 11:56:47 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
@@ -38,7 +38,7 @@ let run r (q : cgi) (dbh : Dbi.connection) _ host' _ =
     let { hostname = hostname } = host' in
     q#redirect ("http://" ^ hostname ^ "/_bin/admin/host.cmo?hostid=" ^
                string_of_int hostid);
-    raise CgiExit
+    return ()
   );
 
   let emails = try q#param "emails" with Not_found -> "" in
index 9123338..a3a874a 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_hostnames.ml,v 1.5 2004/09/09 12:21:22 rich Exp $
+ * $Id: edit_hostnames.ml,v 1.6 2004/09/23 11:56:47 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
@@ -37,14 +37,14 @@ let run r (q : cgi) (dbh : Dbi.connection) _ host' _ =
     let { hostname = hostname } = host' in
     q#redirect ("http://" ^ hostname ^ "/_bin/admin/host.cmo?hostid=" ^
                string_of_int hostid);
-    raise CgiExit
+    return ()
   );
 
   let canonical_hostname = q#param "canonical_hostname" in
   let hostnames = try q#param "hostnames" with Not_found -> "" in
 
   (* In theory we could verify characters in hostnames, and call
-   * error / raise CgiExit if the format is incorrect.  However
+   * error / return () if the format is incorrect.  However
    * it's probably best to assume the sysadmin knows what they're up to
    * here.  If this script is allowed to be accessed by untrusted users,
    * then this has security implications.
index 96cef37..61351d3 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: cocanwiki.ml,v 1.10 2004/09/23 11:51:17 rich Exp $
+ * $Id: cocanwiki.ml,v 1.11 2004/09/23 11:56:47 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
@@ -75,6 +75,8 @@ let server_settings_version =
  *)
 exception CgiExit
 
+let return () = raise CgiExit
+
 (* Permissions and restrictions.
  *
  * Use the optional ~restrict parameter to register_script to restrict
index a13f60e..ba88f1d 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: contact.ml,v 1.2 2004/09/17 15:15:50 rich Exp $
+ * $Id: contact.ml,v 1.3 2004/09/23 11:56:47 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
@@ -36,7 +36,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user =
   let fail msg =
     error ~back_button:true ~title:"Bad form"
       q (msg ^ "  Please contact the owner of the site by email.");
-    raise CgiExit
+    return ()
   in
 
   (* Get the id field. *)
index 9478190..4b4caa6 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: create.ml,v 1.7 2004/09/21 13:01:15 rich Exp $
+ * $Id: create.ml,v 1.8 2004/09/23 11:56:47 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
@@ -40,10 +40,10 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user =
       | Wikilib.GenURL_TooShort | Wikilib.GenURL_BadURL ->
          error ~back_button:true ~title:"Bad page name"
            q "The page name supplied is too short or invalid.";
-         raise CgiExit
+         return ()
       | Wikilib.GenURL_Duplicate url ->
          q#redirect ("http://" ^ hostname ^ "/" ^ url);
-         raise CgiExit in
+         return () in
 
   (* Description field must contain something. *)
   let description = q#param "description" in
@@ -51,7 +51,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user =
     error ~back_button:true ~title:"Description field missing"
       q "You must write a brief description for search engines and
          directories.";
-    raise CgiExit
+    return ()
   );
 
   (* Get the IP address of the user, if available. *)
index 85cb4c1..30a531f 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: create_contact.ml,v 1.1 2004/09/21 15:55:48 rich Exp $
+ * $Id: create_contact.ml,v 1.2 2004/09/23 11:56:47 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. *)
index 3205a10..990cfc0 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: create_form.ml,v 1.6 2004/09/09 12:21:22 rich Exp $
+ * $Id: create_form.ml,v 1.7 2004/09/23 11:56:47 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,10 +42,10 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
       | Wikilib.GenURL_TooShort | Wikilib.GenURL_BadURL ->
          error ~back_button:true ~title:"Bad page name"
            q "The page name supplied is too short or invalid.";
-         raise CgiExit
+         return ()
       | Wikilib.GenURL_Duplicate url ->
          q#redirect ("http://" ^ hostname ^ "/" ^ url);
-         raise CgiExit in
+         return () in
 
   (* Show the form. *)
   template#set "title" title;
index 2e08209..5f6be27 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: create_user.ml,v 1.2 2004/09/22 10:19:26 rich Exp $
+ * $Id: create_user.ml,v 1.3 2004/09/23 11:56:47 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
@@ -36,13 +36,13 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
   if username = "" || password1 = "" || password2 = "" then (
     error ~back_button:true ~title:"Bad username or password"
       q "The username or password you gave is empty.";
-    raise CgiExit
+    return ()
   );
 
   if password1 <> password2 then (
     error ~back_button:true ~title:"Passwords don't match"
       q "The two passwords you gave aren't identical.";
-    raise CgiExit
+    return ()
   );
 
   let password = password1 in
@@ -64,7 +64,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
      sth#fetch1 ();
      error ~back_button:true ~title:"Username already taken"
        q "Someone has already taken that username.";
-     raise CgiExit
+     return ()
    with
        Not_found -> ());
 
index 8f89c14..cfff4a2 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: delete_contact.ml,v 1.1 2004/09/21 15:55:49 rich Exp $
+ * $Id: delete_contact.ml,v 1.2 2004/09/23 11:56:47 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
@@ -31,7 +31,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
   (* Cancel? *)
   if q#param_true "cancel" then (
     q#redirect ("http://" ^ hostname ^ "/_bin/contacts.cmo");
-    raise CgiExit
+    return ()
   );
 
   (* We can delete multiple contact forms from this script, which is
@@ -40,7 +40,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
   let ids = List.map int_of_string (q#param_all "delete") in
   if ids = [] then (
     q#redirect ("http://" ^ hostname ^ "/_bin/contacts.cmo");
-    raise CgiExit
+    return ()
   );
 
   (* Need to check the contact emails all belong to this host. *)
index 4692bb9..55a943b 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: delete_contact_form.ml,v 1.1 2004/09/21 15:55:49 rich Exp $
+ * $Id: delete_contact_form.ml,v 1.2 2004/09/23 11:56:47 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
@@ -36,7 +36,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
   let ids = List.map int_of_string (q#param_all "delete") in
   if ids = [] then (
     q#redirect ("http://" ^ hostname ^ "/_bin/contacts.cmo");
-    raise CgiExit
+    return ()
   );
 
   let qs = Dbi.placeholders (List.length ids) in
index 782c6b0..ab2b8a4 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: delete_user.ml,v 1.1 2004/09/21 13:01:15 rich Exp $
+ * $Id: delete_user.ml,v 1.2 2004/09/23 11:56:47 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
@@ -31,7 +31,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} self =
   if q#param_true "cancel" then (
     (* Request cancelled. *)
     q#redirect ("http://" ^ hostname ^ "/_users");
-    raise CgiExit
+    return ()
   );
 
   let userid = int_of_string (q#param "userid") in
@@ -51,7 +51,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} self =
       | User (id, _, _) when id = userid ->
          error ~back_button:true ~title:"Delete own account"
            q "You cannot delete your own user account.";
-         raise CgiExit
+         return ()
       | _ -> () in
 
   (* Delete the user. *)
index f982f1e..382814a 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: delete_user_form.ml,v 1.1 2004/09/21 13:01:15 rich Exp $
+ * $Id: delete_user_form.ml,v 1.2 2004/09/23 11:56:47 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
@@ -40,7 +40,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ self =
       | User (id, _, _) when id = userid ->
          error ~back_button:true ~title:"Delete own account"
            q "You cannot delete your own user account.";
-         raise CgiExit
+         return ()
       | _ -> () in
 
   (* Get this user from the database. *)
index 00d48ab..5bdf183 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.ml,v 1.10 2004/09/21 13:01:15 rich Exp $
+ * $Id: edit.ml,v 1.11 2004/09/23 11:56:47 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
@@ -382,7 +382,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user =
        template_conflict#set "url" url;
 
        q#template template_conflict;
-       raise CgiExit
+       return ()
       );
 
       (* Defer the pages_redirect_cn constraint because that would
@@ -492,11 +492,11 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user =
      let id = int_of_string (q#param "id") in
      if q#param_true "cancel" then (
        cancel id;
-       raise CgiExit
+       return ()
      );
      if q#param_true "save" then (
        let ok = try_save () in
-       if ok then raise CgiExit                (* ... else fall through *)
+       if ok then return ()            (* ... else fall through *)
      );
      continue_editing ()               (* Processes the action, if any. *)
    with
index 88077e6..18b4a5c 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.1 2004/09/21 18:24:15 rich Exp $
+ * $Id: edit_contact.ml,v 1.2 2004/09/23 11:56:47 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
@@ -45,20 +45,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 ()
   );
 
   (* Need to verify that the contact belongs to the host. *)
index d743865..e51f320 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.1 2004/09/22 12:04:28 rich Exp $
+ * $Id: edit_host_settings.ml,v 1.2 2004/09/23 11:56:47 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
@@ -32,7 +32,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
   if q#param_true "cancel" then (
     (* Request cancelled. *)
     q#redirect ("http://" ^ hostname ^ "/_bin/host_menu.cmo");
-    raise CgiExit
+    return ()
   );
 
   (* Get parameters. *)
index cd1aeb8..38cba43 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_sitemenu.ml,v 1.4 2004/09/09 12:21:22 rich Exp $
+ * $Id: edit_sitemenu.ml,v 1.5 2004/09/23 11:56:47 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
@@ -299,11 +299,11 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
   if q#param_true "inedit" then (
     if q#param_true "cancel" then (
       cancel ();
-      raise CgiExit
+      return ()
     );
     if q#param_true "save" then (
       let ok = try_save () in
-      if ok then raise CgiExit         (* ... else fall through *)
+      if ok then return ()             (* ... else fall through *)
     );
     continue_editing ()                        (* Processes the action, if any. *)
   ) else
index 7f2148e..fb1da46 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_user.ml,v 1.5 2004/09/22 10:19:26 rich Exp $
+ * $Id: edit_user.ml,v 1.6 2004/09/23 11:56:47 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
@@ -45,7 +45,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ self =
     if name = "" then (
       error ~back_button:true ~title:"Bad username"
         q "The username you gave is empty.";
-      raise CgiExit
+      return ()
     );
 
     (* Check it's not a duplicate, then change it. *)
@@ -57,7 +57,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ self =
        sth#fetch1 ();
        error ~back_button:true ~title:"Username already taken"
         q ("That username has already been taken by another user.");
-       raise CgiExit
+       return ()
      with
         Not_found -> ());
 
@@ -83,7 +83,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ self =
           q ("You tried to remove 'Manage users' permission from yourself. "^
              "You can't do this.  You'll have to do it from another "^
              "user account.");
-        raise CgiExit
+        return ()
      | _ -> ());
 
   let sth = dbh#prepare_cached "update users set email = ?,
index 0c2ea5f..daa6ebb 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: forgot_password.ml,v 1.4 2004/09/09 12:21:22 rich Exp $
+ * $Id: forgot_password.ml,v 1.5 2004/09/23 11:56:47 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
@@ -34,7 +34,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
   if name = "" then (
     error ~back_button:true ~title:"No username or email address"
       q "You didn't give a username or email address";
-    raise CgiExit
+    return ()
   );
 
   (* Look it up in the database. *)
index 03c3537..db576c8 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.ml,v 1.17 2004/09/22 10:19:26 rich Exp $
+ * $Id: page.ml,v 1.18 2004/09/23 11:56:47 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
@@ -254,7 +254,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {edit_anon=edit_anon} user =
       error ~title:"Too many redirections" ~back_button:true
         q ("Too many redirects between pages.  This may happen because " ^
           "of a cycle of redirections.");
-      raise CgiExit
+      return ()
     ) else
       match fetch_page page' version allow_redirect with
        | FPOK (pageid, title, description, last_modified_date, has_page_css)->
index 68f47c4..8e18f45 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: restore_form.ml,v 1.7 2004/09/09 12:21:22 rich Exp $
+ * $Id: restore_form.ml,v 1.8 2004/09/23 11:56:47 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
@@ -51,7 +51,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
   if version = old_version then (
     error ~back_button:true ~title:"Restoring live version"
       q "You seem to be trying to restore the live version.";
-    raise CgiExit
+    return ()
   );
 
   let diff, _ = get_diff dbh hostid page ~old_version ~version () in
index 3dc1a1e..6841b71 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: send_feedback.ml,v 1.1 2004/09/20 17:18:26 rich Exp $
+ * $Id: send_feedback.ml,v 1.2 2004/09/23 11:56:47 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
@@ -36,7 +36,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user =
   if q#param_true "cancel" then (
     (* Request cancelled. *)
     q#redirect ("http://" ^ hostname);
-    raise CgiExit
+    return ()
   );
 
   (* Get the feedback email for this host. *)
index 5dfbf29..df9c815 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: set_password.ml,v 1.1 2004/09/21 13:01:16 rich Exp $
+ * $Id: set_password.ml,v 1.2 2004/09/23 11:56:47 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
@@ -35,7 +35,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
   if password1 <> password2 then (
     error ~back_button:true ~title:"Passwords don't match"
       q "The two passwords you gave aren't identical.";
-    raise CgiExit
+    return ()
   );
 
   let password = password1 in
index 0c946f5..5e8fc5f 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: signup.ml,v 1.5 2004/09/09 12:21:22 rich Exp $
+ * $Id: signup.ml,v 1.6 2004/09/23 11:56:47 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,13 +48,13 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
   if username = "" || password1 = "" || password2 = "" then (
     error ~back_button:true ~title:"Bad username or password"
       q "The username or password you gave is empty.";
-    raise CgiExit
+    return ()
   );
 
   if password1 <> password2 then (
     error ~back_button:true ~title:"Passwords don't match"
       q "The two passwords you gave aren't identical.";
-    raise CgiExit
+    return ()
   );
 
   let password = password1 in
@@ -78,7 +78,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
        q ("Someone, possibly you, has already taken that username. " ^
          "If you think you have forgotten your password, try going back " ^
          "and clicking on the 'Forgotten your password?' link.");
-     raise CgiExit
+     return ()
    with
        Not_found -> ());
 
index debe893..a6ed439 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: upload_file.ml,v 1.6 2004/09/09 12:21:22 rich Exp $
+ * $Id: upload_file.ml,v 1.7 2004/09/23 11:56:47 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
@@ -51,14 +51,14 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
        Not_found ->
          error ~title:"No file" ~back_button:true
            q "No file was uploaded.";
-         raise CgiExit in
+         return () in
 
   (* Check the name is valid. *)
   if not (Pcre.pmatch ~rex:file_ok_re name) then (
     error ~title:"Bad File Name" ~back_button:true
       q ("The File Name must contain only lowercase English letters, " ^
         "numbers, dots, dashes and underscore.");
-    raise CgiExit
+    return ()
   );
 
   (* Identify the MIME type from the extension. *)
index 7a0beab..c6d11e2 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: upload_image.ml,v 1.6 2004/09/09 12:21:22 rich Exp $
+ * $Id: upload_image.ml,v 1.7 2004/09/23 11:56:47 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
@@ -53,7 +53,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
        Not_found ->
          error ~title:"No image" ~back_button:true
            q "No image was uploaded.";
-         raise CgiExit in
+         return () in
 
   (* Check the name is valid. *)
   if not (Pcre.pmatch ~rex:image_ok_re name) then (
@@ -61,7 +61,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
       q ("The Image Name must contain only lowercase English letters, " ^
         "numbers and underscore.  It must end with .jpg, .gif or .png " ^
         "depending on the image format.");
-    raise CgiExit
+    return ()
   );
 
   (* Check the image is an image, and get the size. *)
@@ -72,7 +72,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
          error ~title:"Bad image" ~back_button:true
            q ("Unknown image type.  Is the file you uploaded really an " ^
               "image?");
-         raise CgiExit in
+         return () in
 
   (* Check the image filename extension matches the MIME type. *)
   let ext_ok =
@@ -91,7 +91,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
         "For example if the image is in JPEG format, the name must " ^
         "be 'something.jpg'.  I detected the following image type " ^
         "in the file you uploaded: " ^ mime_type);
-    raise CgiExit
+    return ()
   );
 
   (* Check some ALT text was supplied. *)
@@ -100,7 +100,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid { hostname = hostname } _ =
       q ("You must supply Alt text describing the image.  This is required " ^
         "by accessibility laws and to allow search engines to discover the " ^
         "content of images.");
-    raise CgiExit
+    return ()
   );
 
   let title = if is_whitespace title then `Null else `String title in