(* 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.7 2004/10/11 14:13:04 rich Exp $
+ * $Id: edit_user.ml,v 1.9 2004/10/30 10:16:10 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
sth#execute [`String name; `Int hostid; `Int userid]
);
- (* Change email address and permissions. *)
- let email = trim (q#param "email") in
- let email = if email = "" then `Null else `String email in
-
+ (* Change permissions. *)
let can_edit = q#param_true "can_edit" in
let can_manage_users = q#param_true "can_manage_users" in
let can_manage_contacts = q#param_true "can_manage_contacts" in
(* Trying to remove manage users permission from self? *)
(match can_manage_users, self with
- | false, User (id, _, _) when id = userid ->
+ | 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 "^
return ()
| _ -> ());
- let sth = dbh#prepare_cached "update users set email = ?,
+ let sth = dbh#prepare_cached "update users set
can_edit = ?, can_manage_users = ?,
can_manage_contacts = ?,
can_manage_site = ?,
can_edit_global_css = ?,
can_import_mail = ?
where hostid = ? and id = ?" in
- sth#execute [email; `Bool can_edit; `Bool can_manage_users;
+ sth#execute [`Bool can_edit; `Bool can_manage_users;
`Bool can_manage_contacts; `Bool can_manage_site;
`Bool can_edit_global_css; `Bool can_import_mail;
`Int hostid; `Int userid];