git.annexia.org
/
cocanwiki.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Asynchronous updates.
[cocanwiki.git]
/
scripts
/
rename_page.ml
diff --git
a/scripts/rename_page.ml
b/scripts/rename_page.ml
index
8de584f
..
579369c
100644
(file)
--- 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 <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
(* 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:3
2 rich Exp $
+ * $Id: rename_page.ml,v 1.
2 2004/11/22 11:11:5
2 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
*
* 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_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
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 ();
(* 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."
let buttons = [ ok_button ("/" ^ new_page) ] in
ok ~title:"Page renamed" ~buttons
q "That page was renamed."