X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Frename_page.ml;h=579369c48a76a09811ada676bb8e4dfd4b65d2a1;hb=e336401181f56f19ec18175d47462e7a5d5f07e2;hp=8de584f77af30456da8c0118e431bd2f26b4ec92;hpb=0d913c7fee349ac0d46a9f9ce31977b2e5c545af;p=cocanwiki.git diff --git a/scripts/rename_page.ml b/scripts/rename_page.ml index 8de584f..579369c 100644 --- a/scripts/rename_page.ml +++ b/scripts/rename_page.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,6 +28,7 @@ open Cocanwiki 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 @@ -99,6 +100,15 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = (* 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."