(* 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.7 2006/03/27 18:09:46 rich Exp $
+ * $Id: create_user.ml,v 1.8 2006/07/26 16:34:18 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
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
let force_password_change = q#param_true "force_password_change" in
(* Create the user account. *)
hostid, can_edit, can_manage_users,
can_manage_contacts, can_manage_site,
can_edit_global_css, can_import_mail,
+ can_edit_macros,
force_password_change)
values ($username, $password, $hostid, $can_edit, $can_manage_users,
$can_manage_contacts, $can_manage_site,
$can_edit_global_css, $can_import_mail,
+ $can_edit_macros,
$force_password_change)";
PGOCaml.commit dbh;
(* 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.13 2006/07/26 16:34:18 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
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
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. *)
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_user_form.ml,v 1.10 2006/03/27 19:10:29 rich Exp $
+ * $Id: edit_user_form.ml,v 1.11 2006/07/26 16:34:18 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
"select u.name, u.email, u.registration_date,
u.can_edit, u.can_manage_users, u.can_manage_contacts,
u.can_manage_site, u.can_edit_global_css, u.can_import_mail,
+ u.can_edit_macros,
(select count(*) from pages where logged_user = u.id)::int4,
(select count(*) from pages
where logged_user = u.id and url_deleted is null)::int4
let name, email, registration_date, can_edit, can_manage_users,
can_manage_contacts, can_manage_site, can_edit_global_css,
- can_import_mail, nr_edits, nr_edits_live =
+ can_import_mail, can_edit_macros, nr_edits, nr_edits_live =
match rows with
| [name, email, registration_date,
can_edit, can_manage_users, can_manage_contacts,
can_manage_site, can_edit_global_css,
- can_import_mail,
+ can_import_mail, can_edit_macros,
nr_edits, nr_edits_live] ->
name, email, registration_date, can_edit, can_manage_users,
can_manage_contacts, can_manage_site, can_edit_global_css,
- can_import_mail, nr_edits, nr_edits_live
+ can_import_mail, can_edit_macros, nr_edits, nr_edits_live
| _ -> assert false in
template#set "userid" (Int32.to_string userid);
template#conditional "can_manage_site" can_manage_site;
template#conditional "can_edit_global_css" can_edit_global_css;
template#conditional "can_import_mail" can_import_mail;
+ template#conditional "can_edit_macros" can_edit_macros;
template#set "nr_edits" (Int32.to_string (Option.get nr_edits));
template#set "nr_edits_live" (Int32.to_string (Option.get nr_edits_live));
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: users.ml,v 1.10 2006/03/28 16:24:08 rich Exp $
+ * $Id: users.ml,v 1.11 2006/07/26 16:34:18 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
"select id, name, email, registration_date, invite is not null,
can_edit, can_manage_users,
can_manage_contacts, can_manage_site, can_edit_global_css,
- can_import_mail
+ can_import_mail, can_edit_macros
from users where hostid = $hostid order by name" in
let table =
List.map
(fun (userid, name, email, registration_date, invite_pending,
can_edit, can_manage_users, can_manage_contacts, can_manage_site,
- can_edit_global_css, can_import_mail) ->
+ can_edit_global_css, can_import_mail, can_edit_macros) ->
let email = match email with None -> "" | Some s -> s in
let invite_pending = Option.get invite_pending in
[ "userid", Template.VarString (Int32.to_string userid);
"can_edit_global_css",
Template.VarConditional can_edit_global_css;
"can_import_mail",
- Template.VarConditional can_import_mail;]
+ Template.VarConditional can_import_mail;
+ "can_edit_macros",
+ Template.VarConditional can_edit_macros;]
) rows in
template#table "users" table;
<input id="can_edit_global_css" type="checkbox" name="can_edit_global_css" value="1"/><label for="can_edit_global_css">Edit global stylesheet</label>
<br/>
<input id="can_import_mail" type="checkbox" name="can_import_mail" value="1"/><label for="can_import_mail">Import mail</label>
+<br/>
+<input id="can_edit_macros" type="checkbox" name="can_edit_macros" value="1"/><label for="can_edit_macros">Edit macros</label>
</td>
</tr>
<tr>
<input id="can_edit_global_css" type="checkbox" name="can_edit_global_css" value="1" ::if(can_edit_global_css)::checked="checked"::end::/><label for="can_edit_global_css">Edit global stylesheet</label>
<br/>
<input id="can_import_mail" type="checkbox" name="can_import_mail" value="1" ::if(can_import_mail)::checked="checked"::end::/><label for="can_import_mail">Import mail</label>
+<br/>
+<input id="can_edit_macros" type="checkbox" name="can_edit_macros" value="1" ::if(can_edit_macros)::checked="checked"::end::/><label for="can_edit_macros">Edit macros</label>
</td>
</tr>
<tr>
<th> Manage site </th>
<th> Edit global stylesheet </th>
<th> Import mail </th>
+<th> Edit macros </th>
</tr>
::table(users)::
<td> ::if(can_manage_site)::<img src="/_graphics/tick.png" width="10" height="10" alt="Can manage site"/>::end:: </td>
<td> ::if(can_edit_global_css)::<img src="/_graphics/tick.png" width="10" height="10" alt="Can edit global stylesheet"/>::end:: </td>
<td> ::if(can_import_mail)::<img src="/_graphics/tick.png" width="10" height="10" alt="Can import mail"/>::end:: </td>
+<td> ::if(can_edit_macros)::<img src="/_graphics/tick.png" width="10" height="10" alt="Can edit macros"/>::end:: </td>
</tr>
::end::
</table>
</dd>
+<dt> <strong>Edit global stylesheet</strong> </dt>
+<dd>
+
+<p>
+If set, user may edit the <code>{{macros}}</code> which
+can affect many pages.
+</p>
+
+</dd>
+
</dl>
::include(footer.html)::