X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fuser_prefs_form.ml;h=4d66eb7325d35ff808a19f3b80ad85139947d32f;hb=cd059731a60fd3d4dcf426430ad26ff227b91910;hp=efac44a995f4c8f0921958ea538b116e566a4fe7;hpb=32f71ff9f960ecb191f256a6cfc11a3f2c0c0cf7;p=cocanwiki.git diff --git a/scripts/user_prefs_form.ml b/scripts/user_prefs_form.ml index efac44a..4d66eb7 100644 --- a/scripts/user_prefs_form.ml +++ b/scripts/user_prefs_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: user_prefs_form.ml,v 1.3 2004/11/01 12:57:53 rich Exp $ + * $Id: user_prefs_form.ml,v 1.5 2006/03/28 16:24:08 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 @@ -28,7 +28,7 @@ open Cocanwiki open Cocanwiki_template open Cocanwiki_date -let run r (q : cgi) (dbh : Dbi.connection) hostid host user = +let run r (q : cgi) dbh hostid host user = let template = get_template dbh hostid "user_prefs_form.html" in let userid, name, prefs = @@ -39,15 +39,11 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid host user = let can_edit = can_edit host user in (* Pull out the registration date - not stored in the user object. *) - let sth = - dbh#prepare_cached - "select registration_date from users where hostid = ? and id = ?" in - sth#execute [`Int hostid; `Int userid]; - - let registration_date = - match sth#fetch1 () with - [ `Date registration_date ] -> registration_date - | _ -> assert false in + let registration_date = List.hd ( + PGSQL(dbh) + "select registration_date from users + where hostid = $hostid and id = $userid" + ) in let email, has_email = match prefs.email with