More thorough inclusion of the page bug. This should mean the page bug appears just...
[cocanwiki.git] / scripts / edit_user.ml
index b46b905..d9cb59c 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.9 2004/10/30 10:16:10 rich Exp $
+ * $Id: edit_user.ml,v 1.10 2005/11/24 14:54:12 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,7 +44,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ self =
   if original_name <> name then (
     if name = "" then (
       error ~back_button:true ~title:"Bad username"
-        q "The username you gave is empty.";
+        dbh hostid q "The username you gave is empty.";
       return ()
     );
 
@@ -56,7 +56,8 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ self =
     (try
        sth#fetch1 ();
        error ~back_button:true ~title:"Username already taken"
-        q ("That username has already been taken by another user.");
+        dbh hostid q
+        ("That username has already been taken by another user.");
        return ()
      with
         Not_found -> ());
@@ -78,9 +79,10 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ self =
   (match can_manage_users, self with
      | false, User (id, _, _, _) when id = userid ->
         error ~back_button:true ~title:"Remove manage users from 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.");
+          dbh hostid 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.");
         return ()
      | _ -> ());
 
@@ -101,7 +103,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ self =
 
   let buttons = [ ok_button "/_users" ] in
   ok ~buttons ~title:"Saved"
-    q "Changes were saved."
+    dbh hostid q "Changes were saved."
 
 let () =
   register_script ~restrict:[CanManageUsers] run