select count now returns an int8. This fixes the broken 'Recent changes' pages.
[cocanwiki.git] / scripts / edit_user_form.ml
index d8eb82a..ddd7ed1 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_form.ml,v 1.7 2004/10/11 14:13:04 rich Exp $
+ * $Id: edit_user_form.ml,v 1.8 2005/11/23 11:32:13 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
@@ -38,9 +38,9 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
       "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,
-              (select count(*) from pages where logged_user = u.id),
+              (select count(*) from pages where logged_user = u.id)::int4,
               (select count(*) from pages
-                where logged_user = u.id and url_deleted is null)
+                where logged_user = u.id and url_deleted is null)::int4
          from users u where u.hostid = ? and u.id = ?" in
   sth#execute [`Int hostid; `Int userid];