- where logged_user = u.id and url_deleted is null)
- from users u where u.hostid = ? and u.id = ?" in
- sth#execute [`Int hostid; `Int userid];
-
- let name, email, registration_date, can_edit, can_manage_users, nr_edits,
- nr_edits_live =
- match sth#fetch1 () with
- [`String name; (`Null | `String _) as email;
- `Date registration_date;
- `Bool can_edit; `Bool can_manage_users;
- `Int nr_edits; `Int nr_edits_live] ->
- name, email, registration_date, can_edit, can_manage_users,
- nr_edits, nr_edits_live
- | _ -> assert false in
-
- template#set "userid" (string_of_int userid);
+ where logged_user = u.id and url_deleted is null)::int4
+ from users u where u.hostid = $hostid and u.id = $userid" in
+
+ 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 =
+ 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,
+ 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
+ | _ -> assert false in
+
+ template#set "userid" (Int32.to_string userid);