(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: login_form.ml,v 1.6 2006/03/27 18:09:46 rich Exp $
+ * $Id: login_form.ml,v 1.7 2006/03/28 13:20:00 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 username = try q#param "username" with Not_found -> "" in
template#set "username" username;
- let sth = dbh#prepare_cached "select create_account_anon from hosts
- where id = ?" in
- sth#execute [Some hostid];
-
let create_account_anon =
- match sth#fetch1 () with
- [ `Bool b ] -> b
- | _ -> assert false in
+ List.hd (
+ PGSQL(dbh) "select create_account_anon from hosts
+ where id = $hostid"
+ ) in
template#conditional "create_account_anon" create_account_anon;