X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fedit.ml;h=8b4482312b7344347720bb0455203768c080d14a;hb=295f2cde3f43ccf7f775d39b95925e10aa4c37cb;hp=2e4a6cd3a19629a99808c44848e0956b2cdf092f;hpb=6eacefcb7258db7b56fe796af84961cafac90eac;p=cocanwiki.git diff --git a/scripts/edit.ml b/scripts/edit.ml index 2e4a6cd..8b44823 100644 --- a/scripts/edit.ml +++ b/scripts/edit.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit.ml,v 1.20 2004/10/11 14:13:04 rich Exp $ + * $Id: edit.ml,v 1.26 2005/03/31 14:24:04 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 @@ -48,7 +48,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = ignore (String.find ua "MSIE"); (* Throws Invalid_string if not found. *) true with - Not_found | String.Invalid_string -> false in + Not_found | Invalid_string -> false in template#conditional "msie" msie; (* Build the internal model from the parameters passed to the script. *) @@ -359,8 +359,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = | SaveConflict (new_version, old_version, url, css) -> (* Edited by someone else ... Get the other's changes. *) let other_diff, _ = - get_diff dbh hostid url - ~old_version ~version:new_version () in + get_diff dbh hostid url ~old_version ~version:new_version () in (* Synthesize our own changes. *) let old_page = get_version_for_diff dbh old_version in @@ -408,7 +407,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = template_email#set "opt_out" opt_out; let body = template_email#to_string in Sendmail.send_mail ~subject - ~to_addr:[to_addr] ~body ()) + ~to_addr:[to_addr] body) addrs ); @@ -431,7 +430,7 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = "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); @@ -442,7 +441,8 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = 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 ()