(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: rename_page.ml,v 1.1 2004/11/22 11:07:32 rich Exp $
+ * $Id: rename_page.ml,v 1.2 2004/11/22 11:11:52 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_ok
open Cocanwiki_pages
open Cocanwiki_strings
+open Cocanwiki_emailnotify
let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user =
let page = q#param "page" in
(* Finish off XXX *)
dbh#commit ();
+ (* Email notification. *)
+ let subject = "Page " ^ page ^ " has been renamed" in
+
+ let body = fun () ->
+ "Old title: " ^ old_title ^ "\n" ^
+ "New title: " ^ new_title in
+
+ email_notify ~body ~subject ~user dbh hostid;
+
let buttons = [ ok_button ("/" ^ new_page) ] in
ok ~title:"Page renamed" ~buttons
q "That page was renamed."