(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: rename_page_form.ml,v 1.1 2004/11/22 11:07:32 rich Exp $
+ * $Id: rename_page_form.ml,v 1.3 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
open Cocanwiki
open Cocanwiki_template
-let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ =
+let run r (q : cgi) dbh hostid _ _ =
let template = get_template dbh hostid "rename_page_form.html" in
let page = q#param "page" in
- let sth = dbh#prepare_cached "select title from pages
- where hostid = ? and url = ?" in
- sth#execute [`Int hostid; `String page];
-
- let title = sth#fetch1string () in
+ let title = List.hd (
+ PGSQL(dbh) "select title from pages
+ where hostid = $hostid and url = $page"
+ ) in
template#set "page" page;
template#set "title" title;