Updated MANIFEST.
[cocanwiki.git] / scripts / edit_user.ml
index bfbd191..34ba7ce 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.12 2006/03/27 19:10:29 rich Exp $
+ * $Id: edit_user.ml,v 1.14 2006/12/06 09:46:57 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 hostid _ self =
   if original_name <> name then (
     if name = "" then (
       error ~back_button:true ~title:"Bad username"
-        dbh hostid q "The username you gave is empty.";
+        dbh hostid q "The username you gave is empty.";
       return ()
     );
 
@@ -56,7 +56,7 @@ let run r (q : cgi) dbh hostid _ self =
     (match rows with
      | [Some 1l] ->
         error ~back_button:true ~title:"Username already taken"
-          dbh hostid q
+          dbh hostid q
           ("That username has already been taken by another user.");
         return ()
      | _ -> ()
@@ -73,12 +73,13 @@ let run r (q : cgi) dbh hostid _ self =
   let can_manage_site = q#param_true "can_manage_site" in
   let can_edit_global_css = q#param_true "can_edit_global_css" in
   let can_import_mail = q#param_true "can_import_mail" in
+  let can_edit_macros = q#param_true "can_edit_macros" in
 
   (* Trying to remove manage users permission from self? *)
   (match can_manage_users, self with
      | false, User (id, _, _, _) when id = userid ->
         error ~back_button:true ~title:"Remove manage users from self"
-          dbh hostid q
+          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.");
@@ -91,7 +92,8 @@ let run r (q : cgi) dbh hostid _ self =
        can_manage_contacts = $can_manage_contacts,
        can_manage_site = $can_manage_site,
        can_edit_global_css = $can_edit_global_css,
-       can_import_mail = $can_import_mail
+       can_import_mail = $can_import_mail,
+       can_edit_macros = $can_edit_macros
      where hostid = $hostid and id = $userid";
 
   (* Finish up. *)
@@ -99,7 +101,7 @@ let run r (q : cgi) dbh hostid _ self =
 
   let buttons = [ ok_button "/_users" ] in
   ok ~buttons ~title:"Saved"
-    dbh hostid q "Changes were saved."
+    dbh hostid q "Changes were saved."
 
 let () =
   register_script ~restrict:[CanManageUsers] run