(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit.ml,v 1.20 2004/10/11 14:13:04 rich Exp $
+ * $Id: edit.ml,v 1.23 2004/10/30 10:16:10 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
| SaveConflict (new_version, old_version, url, css) ->
(* Edited by someone else ... Get the other's changes. *)
let other_diff, _ =
- get_diff dbh hostid url
+ get_diff dbh hostid ~user url
~old_version ~version:new_version () in
(* Synthesize our own changes. *)
let new_page =
page_for_diff css (List.map (fun (sectionname, _, content) ->
sectionname, content) model.contents) in
- let our_diff = diff_cmd old_page new_page in
+ let our_diff = diff_cmd ~user old_page new_page in
(* Fill out the conflict template. *)
template_conflict#set "other_diff" other_diff;
let body = fun () ->
(* Prepare the diff between this version and the previous version. *)
- let diff, _ = get_diff dbh hostid url ~version:pageid () in
+ let diff, _ = get_diff dbh hostid ~user url ~version:pageid () in
"Page: http://" ^ hostname ^ "/" ^ url ^ "\n\n" ^
diff in
- email_notify ~body ~subject dbh hostid;
+ email_notify ~body ~subject ~user dbh hostid;
(* Redirect back to the URL. *)
q#redirect ("http://" ^ hostname ^ "/" ^ url);
let cancel id =
let url =
if id <> 0 then (
- let sth = dbh#prepare_cached "select url from pages
+ let sth = dbh#prepare_cached "select coalesce (url, url_deleted)
+ from pages
where hostid = ? and id = ?" in
sth#execute [`Int hostid; `Int id];
sth#fetch1string ()