git.annexia.org
/
cocanwiki.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added machine-parsable links database, per-page links and page source.
[cocanwiki.git]
/
scripts
/
edit_user.ml
diff --git
a/scripts/edit_user.ml
b/scripts/edit_user.ml
index
38f98b3
..
234c5a6
100644
(file)
--- a/
scripts/edit_user.ml
+++ b/
scripts/edit_user.ml
@@
-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.
(* 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.
4 2004/09/17 15:24:5
4 rich Exp $
+ * $Id: edit_user.ml,v 1.
8 2004/10/23 15:00:1
4 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
*
* 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.";
if name = "" then (
error ~back_button:true ~title:"Bad username"
q "The username you gave is empty.";
- r
aise CgiExit
+ r
eturn ()
);
(* Check it's not a duplicate, then change it. *)
);
(* 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.");
sth#fetch1 ();
error ~back_button:true ~title:"Username already taken"
q ("That username has already been taken by another user.");
- r
aise CgiExit
+ r
eturn ()
with
Not_found -> ());
with
Not_found -> ());
@@
-66,13
+66,13
@@
let run r (q : cgi) (dbh : Dbi.connection) hostid _ self =
sth#execute [`String name; `Int hostid; `Int userid]
);
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
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
+ 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
(* Trying to remove manage users permission from self? *)
(match can_manage_users, self with
(* Trying to remove manage users permission from self? *)
(match can_manage_users, self with
@@
-81,15
+81,19
@@
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.");
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.");
- r
aise CgiExit
+ r
eturn ()
| _ -> ());
| _ -> ());
- let sth = dbh#prepare_cached "update users set
email = ?,
+ let sth = dbh#prepare_cached "update users set
can_edit = ?, can_manage_users = ?,
can_edit = ?, can_manage_users = ?,
- can_manage_contacts = ?
+ can_manage_contacts = ?,
+ can_manage_site = ?,
+ can_edit_global_css = ?,
+ can_import_mail = ?
where hostid = ? and id = ?" in
where hostid = ? and id = ?" in
- sth#execute [email; `Bool can_edit; `Bool can_manage_users;
- `Bool can_manage_contacts;
+ 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];
(* Finish up. *)
`Int hostid; `Int userid];
(* Finish up. *)