2 * Written by Richard W.M. Jones <rich@merjis.com>.
3 * Copyright (C) 2004 Merjis Ltd.
4 * $Id: login_form.ml,v 1.2 2004/09/08 15:46:53 rich Exp $
13 open Cocanwiki_template
14 open Cocanwiki_strings
16 let run r (q : cgi) (dbh : Dbi.connection) (hostid, _, _) _ =
17 let template = get_template dbh hostid "login_form.html" in
19 let redirect = try q#param "redirect" with Not_found -> "" in
21 if string_is_whitespace redirect then
22 template#conditional "has_redirect" false
24 template#conditional "has_redirect" true;
25 template#set "redirect" redirect
28 let sth = dbh#prepare_cached "select create_account_anon from hosts
30 sth#execute [`Int hostid];
32 let create_account_anon =
33 match sth#fetch1 () with
35 | _ -> assert false in
37 template#conditional "create_account_anon" create_account_anon;