If anonymous account creation isn't allowed, then don't print
[cocanwiki.git] / scripts / login_form.ml
index 39fbb06..9d2ed94 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: login_form.ml,v 1.7 2006/03/28 13:20:00 rich Exp $
+ * $Id: login_form.ml,v 1.8 2006/07/26 13:19:49 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,8 @@ open Cocanwiki
 open Cocanwiki_template
 open Cocanwiki_strings
 
-let run r (q : cgi) dbh hostid _ _ =
+let run r (q : cgi) dbh hostid
+    { create_account_anon = create_account_anon } _ =
   let template = get_template dbh hostid "login_form.html" in
 
   let redirect = try q#param "redirect" with Not_found -> "" in
@@ -43,12 +44,6 @@ let run r (q : cgi) dbh hostid _ _ =
   let username = try q#param "username" with Not_found -> "" in
   template#set "username" username;
 
-  let create_account_anon =
-    List.hd (
-      PGSQL(dbh) "select create_account_anon from hosts
-                   where id = $hostid"
-    ) in
-
   template#conditional "create_account_anon" create_account_anon;
 
   q#template template