force_password_change boolean DEFAULT false NOT NULL,
can_import_mail boolean DEFAULT false NOT NULL,
email_notify boolean DEFAULT true NOT NULL,
- invite text,
- diff_sidebyside boolean DEFAULT false NOT NULL
+ invite text
);
lib/cocanwiki.cmx: lib/cocanwiki_ok.cmx lib/cocanwiki_strings.cmx
lib/cocanwiki_create_host.cmo: lib/cocanwiki_create_host.cmi
lib/cocanwiki_create_host.cmx: lib/cocanwiki_create_host.cmi
-lib/cocanwiki_diff.cmo: lib/cocanwiki.cmo lib/cocanwiki_files.cmo
-lib/cocanwiki_diff.cmx: lib/cocanwiki.cmx lib/cocanwiki_files.cmx
+lib/cocanwiki_diff.cmo: lib/cocanwiki.cmo lib/cocanwiki_files.cmo \
+ lib/cocanwiki_diff.cmi
+lib/cocanwiki_diff.cmx: lib/cocanwiki.cmx lib/cocanwiki_files.cmx \
+ lib/cocanwiki_diff.cmi
lib/cocanwiki_emailnotify.cmo: lib/cocanwiki.cmo
lib/cocanwiki_emailnotify.cmx: lib/cocanwiki.cmx
lib/cocanwiki_ext_calendar.cmo: lib/cocanwiki.cmo lib/cocanwiki_date.cmo \
lib/cocanwiki_pages.cmx: lib/cocanwiki.cmx lib/cocanwiki_links.cmx \
lib/cocanwiki_strings.cmx lib/wikilib.cmx lib/cocanwiki_pages.cmi
lib/cocanwiki_template.cmo: lib/cocanwiki_files.cmo lib/cocanwiki_strings.cmo \
- lib/cocanwiki_template.cmi
+ lib/cocanwiki_version.cmo lib/cocanwiki_template.cmi
lib/cocanwiki_template.cmx: lib/cocanwiki_files.cmx lib/cocanwiki_strings.cmx \
- lib/cocanwiki_template.cmi
+ lib/cocanwiki_version.cmx lib/cocanwiki_template.cmi
lib/wikilib.cmo: lib/cocanwiki_strings.cmo lib/wikilib.cmi
lib/wikilib.cmx: lib/cocanwiki_strings.cmx lib/wikilib.cmi
lib/cocanwiki_mail.cmi: lib/cocanwiki.cmo
lib/cocanwiki_template.cmi
delete_user_form.cmx: lib/cocanwiki.cmx lib/cocanwiki_ok.cmx \
lib/cocanwiki_template.cmx
-diff.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmo lib/cocanwiki_template.cmi
+diff.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmi lib/cocanwiki_template.cmi
diff.cmx: lib/cocanwiki.cmx lib/cocanwiki_diff.cmx lib/cocanwiki_template.cmx
-edit.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmo \
+edit.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmi \
lib/cocanwiki_emailnotify.cmo lib/cocanwiki_ok.cmo \
lib/cocanwiki_pages.cmi lib/cocanwiki_strings.cmo \
lib/cocanwiki_template.cmi lib/wikilib.cmi
edit_host_settings.cmx: lib/cocanwiki.cmx lib/cocanwiki_ok.cmx
edit_host_settings_form.cmo: lib/cocanwiki.cmo lib/cocanwiki_template.cmi
edit_host_settings_form.cmx: lib/cocanwiki.cmx lib/cocanwiki_template.cmx
-edit_page_css.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmo \
+edit_page_css.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmi \
lib/cocanwiki_emailnotify.cmo lib/cocanwiki_ok.cmo \
lib/cocanwiki_strings.cmo
edit_page_css.cmx: lib/cocanwiki.cmx lib/cocanwiki_diff.cmx \
lib/cocanwiki_template.cmx
recently_visited.cmo: lib/cocanwiki.cmo lib/cocanwiki_template.cmi
recently_visited.cmx: lib/cocanwiki.cmx lib/cocanwiki_template.cmx
-restore.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmo \
+restore.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmi \
lib/cocanwiki_emailnotify.cmo lib/cocanwiki_links.cmi \
lib/cocanwiki_ok.cmo
restore.cmx: lib/cocanwiki.cmx lib/cocanwiki_diff.cmx \
lib/cocanwiki_emailnotify.cmx lib/cocanwiki_links.cmx \
lib/cocanwiki_ok.cmx
-restore_form.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmo \
+restore_form.cmo: lib/cocanwiki.cmo lib/cocanwiki_diff.cmi \
lib/cocanwiki_ok.cmo lib/cocanwiki_template.cmi
restore_form.cmx: lib/cocanwiki.cmx lib/cocanwiki_diff.cmx \
lib/cocanwiki_ok.cmx lib/cocanwiki_template.cmx
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: diff.ml,v 1.8 2004/10/30 10:16:10 rich Exp $
+ * $Id: diff.ml,v 1.9 2004/11/01 12:57:53 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
let diff, old_version =
try
let old_version = int_of_string (q#param "old_version") in
- get_diff dbh hostid ~user page ~old_version ~version ()
+ get_diff dbh hostid page ~old_version ~version ()
with
Not_found ->
- get_diff dbh hostid ~user page ~version () in
+ get_diff dbh hostid page ~version () in
template#set "version" (string_of_int version);
template#set "old_version" (string_of_int old_version);
(* 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.23 2004/10/30 10:16:10 rich Exp $
+ * $Id: edit.ml,v 1.24 2004/11/01 12:57:53 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 ~user 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
let new_page =
page_for_diff css (List.map (fun (sectionname, _, content) ->
sectionname, content) model.contents) in
- let our_diff = diff_cmd ~user old_page new_page in
+ let our_diff = diff_cmd 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 ~user url ~version:pageid () in
+ let diff, _ = get_diff dbh hostid url ~version:pageid () in
"Page: http://" ^ hostname ^ "/" ^ url ^ "\n\n" ^
diff in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_page_css.ml,v 1.14 2004/10/30 10:16:10 rich Exp $
+ * $Id: edit_page_css.ml,v 1.15 2004/11/01 12:57:53 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
let subject = "CSS for page " ^ page ^ " has been modified" in
let body = fun () ->
let diff, _ =
- get_diff dbh hostid ~user page
- ~version:pageid ~old_version:oldpageid () in
+ get_diff dbh hostid page ~version:pageid ~old_version:oldpageid () in
"Page: http://" ^ hostname ^ "/" ^ page ^ "\n\n" ^
diff in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki.ml,v 1.2 2004/10/30 10:16:10 rich Exp $
+ * $Id: cocanwiki.ml,v 1.3 2004/11/01 12:57:53 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
type prefs_t = {
email : string option; (* Email address. *)
email_notify : bool; (* Email notification. *)
- diff_sidebyside : bool; (* Shows diffs side-by-side. *)
}
(* The "user object". *)
"select u.id, u.name, u.can_edit, u.can_manage_users,
u.can_manage_contacts, u.can_manage_site,
u.can_edit_global_css, u.can_import_mail,
- u.email, u.email_notify, u.diff_sidebyside
+ u.email, u.email_notify
from usercookies uc, users u
where uc.cookie = ? and uc.userid = u.id and u.hostid = ?" in
sth#execute [`String cookie; `Int hostid];
`Bool can_edit; `Bool can_manage_users;
`Bool can_manage_contacts; `Bool can_manage_site;
`Bool can_edit_global_css; `Bool can_import_mail;
- (`Null | `String _) as email; `Bool email_notify;
- `Bool diff_sidebyside ] ->
+ (`Null | `String _) as email; `Bool email_notify ] ->
(* Every logged in user can view. *)
let perms = [CanView] in
let perms =
`Null -> None
| `String email -> Some email in
let prefs = { email = email;
- email_notify = email_notify;
- diff_sidebyside = diff_sidebyside } in
+ email_notify = email_notify; } in
User (userid, name, perms, prefs)
| _ -> assert false)
with
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_diff.ml,v 1.2 2004/10/30 10:16:10 rich Exp $
+ * $Id: cocanwiki_diff.ml,v 1.3 2004/11/01 12:57:53 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
let le_re = Pcre.regexp "\r?\n"
let le_subst = Pcre.subst "\n"
-let diff_cmd ~user old_page new_page =
+let diff_cmd old_page new_page =
(* Convert line-endings in the input files from \r\n to \n. Diff
* can get confused by the \r characters, particularly in side-by-side
* mode when asked to expand tabs (-y -t).
let new_filename = output_tempfile new_page in
let old_filename = output_tempfile old_page in
- let diff_sidebyside =
- match user with
- Anonymous -> false
- | User (_, _, _, prefs) -> prefs.diff_sidebyside in
+ (* Side-by-side mode was good, but stupidly implemented. It's
+ * disabled right now.
+ *)
+ let diff_sidebyside = false in
let options =
if not diff_sidebyside then
page
)
-let get_diff (dbh : Dbi.connection) hostid ~user page ?old_version ~version ()=
+let get_diff (dbh : Dbi.connection) hostid page ?old_version ~version ()=
let old_version =
match old_version with
| Some version -> version
let old_page = get_version_for_diff dbh old_version in
(* Compute the diff of the two versions. *)
- let diff = diff_cmd ~user old_page new_page in
+ let diff = diff_cmd old_page new_page in
diff, old_version
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_diff.mli,v 1.1 2004/10/30 10:16:10 rich Exp $
+ * $Id: cocanwiki_diff.mli,v 1.2 2004/11/01 12:57:53 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
val page_for_diff : string -> (string * string) list -> string
-val diff_cmd : user:Cocanwiki.user_t -> string -> string -> string
+val diff_cmd : string -> string -> string
val get_version_for_diff : Dbi.connection -> int -> string
-val get_diff :
- Dbi.connection ->
- int ->
- user:Cocanwiki.user_t ->
+val get_diff : Dbi.connection -> int ->
string -> ?old_version:int -> version:int -> unit -> string * int
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_emailnotify.ml,v 1.4 2004/10/30 10:16:10 rich Exp $
+ * $Id: cocanwiki_emailnotify.ml,v 1.5 2004/11/01 12:57:53 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
* 'email_notify' table. Don't send email to invited accounts
* who have not yet confirmed.
*)
- let sth = dbh#prepare_cached "select email, name from users
+ let sth = dbh#prepare_cached "select email, name
+ from users
where hostid = ? and id <> ? and email_notify
and email is not null
and invite is null" in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: restore.ml,v 1.15 2004/10/30 10:16:10 rich Exp $
+ * $Id: restore.ml,v 1.16 2004/11/01 12:57:53 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
let subject = "Page " ^ page ^ " has been restored." in
let body = fun () ->
(* Prepare the diff between this version and the previous version. *)
- let diff, _ = get_diff dbh hostid ~user page ~version:pageid () in
+ let diff, _ = get_diff dbh hostid page ~version:pageid () in
"Page: http://" ^ hostname ^ "/" ^ page ^ "\n\n" ^
diff in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: restore_form.ml,v 1.9 2004/10/30 10:16:10 rich Exp $
+ * $Id: restore_form.ml,v 1.10 2004/11/01 12:57:53 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
return ()
);
- let diff, _ = get_diff dbh hostid ~user page ~old_version ~version () in
+ let diff, _ = get_diff dbh hostid page ~old_version ~version () in
(* Display the diff. *)
template#set "diff" diff;
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: user_prefs.ml,v 1.3 2004/10/30 10:16:10 rich Exp $
+ * $Id: user_prefs.ml,v 1.4 2004/11/01 12:57:53 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
(* Get the fields. *)
let new_email = trim (q#param "email") in
let email_notify = q#param_true "email_notify" in
- let diff_sidebyside = q#param_true "diff_sidebyside" in
let userid =
match user with
(* Update the preferences fields. *)
let sth =
- dbh#prepare_cached "update users set email_notify = ?, diff_sidebyside = ?
+ dbh#prepare_cached "update users set email_notify = ?
where hostid = ? and id = ?" in
- sth#execute [`Bool email_notify; `Bool diff_sidebyside;
+ sth#execute [`Bool email_notify;
`Int hostid; `Int userid];
(* Have we changed the email address? *)
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: user_prefs_form.ml,v 1.2 2004/10/30 10:16:10 rich Exp $
+ * $Id: user_prefs_form.ml,v 1.3 2004/11/01 12:57:53 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
template#set "registration_date" (printable_date' registration_date);
template#conditional "can_edit" can_edit;
template#conditional "email_notify" prefs.email_notify;
- template#conditional "diff_sidebyside" prefs.diff_sidebyside;
q#template template
<tr>
<td></td>
<td>
- <input type="checkbox" id="email_notify" name="email_notify" value="1" ::if(email_notify)::checked="checked"::end::/> <label for="email_notify">Receive email notifications <small>when the site is edited</small></label> <br/>
- <input type="checkbox" id="diff_sidebyside" name="diff_sidebyside" value="1" ::if(diff_sidebyside)::checked="checked"::end::/> <label for="diff_sidebyside">Diffs formatted side-by-side</label>
+ <input type="checkbox" id="email_notify" name="email_notify" value="1" ::if(email_notify)::checked="checked"::end::/> <label for="email_notify">Receive email notifications <small>when the site is edited</small></label>
</td>
</tr>
<tr>