# Apache configuration for COCANWIKI.
-# $Id: cocanwiki.conf,v 1.24 2006/09/22 10:50:37 rich Exp $
+# $Id: cocanwiki.conf,v 1.25 2006/12/06 09:46:54 rich Exp $
# Uncomment the following lines if necessary. You will probably need
# to adjust the paths to reflect where cocanwiki is really installed.
RewriteRule ^/_email_change$ /_bin/email_change.cmo [PT,L,QSA]
RewriteRule ^/_files$ /_bin/files.cmo [PT,L,QSA]
RewriteRule ^/_global.css$ /_bin/hoststyle.cmo [PT,L,QSA]
+RewriteRule ^/_ie6_fixes.css$ /_bin/hoststyle.cmo?css=ie6_fixes [PT,L,QSA]
+RewriteRule ^/_ie7_fixes.css$ /_bin/hoststyle.cmo?css=ie7_fixes [PT,L,QSA]
RewriteRule ^/_images$ /_bin/images.cmo [PT,L,QSA]
RewriteRule ^/_invite$ /_bin/invite_user_confirm_form.cmo [PT,L,QSA]
RewriteRule ^/_links$ /_bin/links.cmo [PT,L,QSA]
brand_description text,
pagebug text,
ie_imagetoolbar_no boolean DEFAULT false NOT NULL,
- global_noodp boolean DEFAULT false NOT NULL
+ global_noodp boolean DEFAULT false NOT NULL,
+ ie6_fixes_css text,
+ ie7_fixes_css text
);
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: create_host.ml,v 1.13 2006/08/16 15:27:02 rich Exp $
+ * $Id: create_host.ml,v 1.14 2006/12/06 09:46:57 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 title = trim title in
if title = "" then (
Cocanwiki_ok.error ~back_button:true ~title:"Bad title"
- dbh (-1l) q "You must give a title for this Wiki.";
+ r dbh (-1l) q "You must give a title for this Wiki.";
) else (
(* In theory we could verify characters in hostnames. However
* it's probably best to assume the sysadmin knows what they're up to
] in
Cocanwiki_ok.ok ~title:"Wiki created" ~buttons
- dbh (-1l) q "A new Wiki was created."
+ r dbh (-1l) q "A new Wiki was created."
)
let () =
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_host_css.ml,v 1.9 2006/03/28 16:24:08 rich Exp $
+ * $Id: edit_host_css.ml,v 1.10 2006/12/06 09:46:57 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
] in
ok ~title:"Stylesheet changed" ~buttons
- dbh (-1l) q
+ r dbh (-1l) q
("The stylesheet was changed successfully. " ^
"Note: You must RELOAD the page to see changes to stylesheets.")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_hostnames.ml,v 1.12 2006/08/16 15:27:02 rich Exp $
+ * $Id: edit_hostnames.ml,v 1.13 2006/12/06 09:46:57 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
] in
ok ~title:"Saved" ~buttons
- dbh (-1l) q "Hostnames updated."
+ r dbh (-1l) q "Hostnames updated."
let () =
register_script run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: broken_links.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: broken_links.ml,v 1.3 2006/12/06 09:46:56 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 keys h = Hashtbl.fold (fun key _ xs -> key :: xs) h []
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "broken_links.html" in
+ let template = get_template r dbh hostid "broken_links.html" in
(* The links table (to_url) field can now point to a non-existant
* page. It's from this observation that we are able to retrieve
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: change_password.ml,v 1.5 2006/03/27 18:09:46 rich Exp $
+ * $Id: change_password.ml,v 1.6 2006/12/06 09:46:56 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
if not old_password_ok then (
error ~title:"Bad password"
~back_button:true
- dbh hostid q "The password you gave is wrong.";
+ r dbh hostid q "The password you gave is wrong.";
return ()
);
if password1 = "" || password2 = "" then (
error ~back_button:true ~title:"Bad password"
- dbh hostid q "The password you gave is empty.";
+ r dbh hostid q "The password you gave is empty.";
return ()
);
if password1 <> password2 then (
error ~back_button:true ~title:"Passwords don't match"
- dbh hostid q "The two passwords you gave aren't identical.";
+ r dbh hostid q "The two passwords you gave aren't identical.";
return ()
);
let buttons = [ ok_button "/" ] in
ok ~buttons ~title:"Password changed"
- dbh hostid q "The password was changed."
+ r dbh hostid q "The password was changed."
let () =
register_script ~anonymous:false run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: change_password_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: change_password_form.ml,v 1.3 2006/12/06 09:46:56 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "change_password_form.html" in
+ let template = get_template r dbh hostid "change_password_form.html" in
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: contact.ml,v 1.13 2006/07/31 09:49:42 rich Exp $
+ * $Id: contact.ml,v 1.14 2006/12/06 09:46:56 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 subj_rex = Pcre.regexp "\\$\\w+"
let run r (q : cgi) dbh hostid {hostname = hostname} user =
- let template = get_template dbh hostid "contact.txt" in
+ let template = get_template r dbh hostid "contact.txt" in
let fail msg =
error ~back_button:true ~title:"Bad form"
- dbh hostid q (msg ^ " Please contact the owner of the site by email.");
+ r dbh hostid q
+ (msg ^ " Please contact the owner of the site by email.");
return ()
in
(* Confirm. *)
ok ~title:"Thank you for your contact" ~buttons:[ok_button "/"]
- dbh hostid q "An email was sent and you should receive a reply shortly."
+ r dbh hostid q "An email was sent and you should receive a reply shortly."
let () =
register_script ~restrict:[CanView] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: contact_show.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: contact_show.ml,v 1.3 2006/12/06 09:46:56 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "contact_show.html" in
+ let template = get_template r dbh hostid "contact_show.html" in
let id = Int32.of_string (q#param "id") in
template#set "id" (Int32.to_string id);
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: contacts.ml,v 1.3 2006/03/27 18:09:46 rich Exp $
+ * $Id: contacts.ml,v 1.4 2006/12/06 09:46:56 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "contacts.html" in
+ let template = get_template r dbh hostid "contacts.html" in
(* Pull out all the contacts from the database. *)
let rows = PGSQL(dbh)
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: crash.ml,v 1.6 2006/07/31 09:49:42 rich Exp $
+ * $Id: crash.ml,v 1.7 2006/12/06 09:46:56 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 run r (q : cgi) dbh hostid
{ canonical_hostname = canonical_hostname } _ =
- let template = get_template dbh hostid "crash.html" in
+ let template = get_template r dbh hostid "crash.html" in
let crash_email = server_settings_crash_email dbh in
(* Get the current time and write it into the logs. *)
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: create_contact.ml,v 1.6 2006/03/27 18:09:46 rich Exp $
+ * $Id: create_contact.ml,v 1.7 2006/12/06 09:46:56 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
if name = "" then (
error ~back_button:true ~title:"Name field missing"
- dbh hostid q "You must name your contact form.";
+ r dbh hostid q "You must name your contact form.";
return ()
);
if subject = "" then (
error ~back_button:true ~title:"Subject line missing"
- dbh hostid q
+ r dbh hostid q
"You must give a subject line, which appears on contact emails.";
return ()
);
if emails = [] then (
error ~back_button:true ~title:"No email addresses"
- dbh hostid q
+ r dbh hostid q
("There are no email addresses listed for this contact form. You " ^
"must list at least one valid email address.");
return ()
Template.StdPages.method_ = None;
Template.StdPages.params =
[ "id", Int32.to_string contactid ] } ] in
- ok ~title:"Contact form created" ~buttons dbh hostid q msg
+ ok ~title:"Contact form created" ~buttons r dbh hostid q msg
let () =
register_script ~restrict:[CanManageContacts] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: create_contact_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: create_contact_form.ml,v 1.3 2006/12/06 09:46:56 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "create_contact_form.html" in
+ let template = get_template r dbh hostid "create_contact_form.html" in
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: create_macro.ml,v 1.1 2006/07/26 16:26:43 rich Exp $
+ * $Id: create_macro.ml,v 1.2 2006/12/06 09:46:56 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
if name = "" then (
error ~back_button:true ~title:"Name field missing"
- dbh hostid q "You must name your macro.";
+ r dbh hostid q "You must name your macro.";
return ()
);
if not (Pcre.pmatch ~rex:name_re name) then (
error ~back_button:true ~title:"Name field invalid"
- dbh hostid q "Name field can only contain letters and numbers.";
+ r dbh hostid q "Name field can only contain letters and numbers.";
return ()
);
PGOCaml.commit dbh;
let buttons = [ ok_button "/_bin/edit_macros.cmo" ] in
- ok ~title:"Macro created" ~buttons dbh hostid q
+ ok ~title:"Macro created" ~buttons r dbh hostid q
"That macro was created."
let () =
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: create_macro_form.ml,v 1.1 2006/07/26 16:26:43 rich Exp $
+ * $Id: create_macro_form.ml,v 1.2 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "create_macro_form.html" in
+ let template = get_template r dbh hostid "create_macro_form.html" in
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: create_user.ml,v 1.8 2006/07/26 16:34:18 rich Exp $
+ * $Id: create_user.ml,v 1.9 2006/12/06 09:46:57 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
if username = "" || password1 = "" || password2 = "" then (
error ~back_button:true ~title:"Bad username or password"
- dbh hostid q "The username or password you gave is empty.";
+ r dbh hostid q "The username or password you gave is empty.";
return ()
);
if password1 <> password2 then (
error ~back_button:true ~title:"Passwords don't match"
- dbh hostid q "The two passwords you gave aren't identical.";
+ r dbh hostid q "The two passwords you gave aren't identical.";
return ()
);
if UTF8.length username > 32 || UTF8.length password > 128 then (
error ~back_button:true ~title:"Username or password too long"
- dbh hostid q "Usernames should be less than 32 characters long. For passwords we let you have a generous 128 characters.";
+ r dbh hostid q
+ "Usernames should be less than 32 characters long. For passwords we let you have a generous 128 characters.";
return ()
);
(match rows with
| [_] ->
error ~back_button:true ~title:"Username already taken"
- dbh hostid q "Someone has already taken that username.";
+ r dbh hostid q "Someone has already taken that username.";
return ()
| [] -> ()
| _ -> assert false
let buttons = [ ok_button "/_users" ] in
ok ~title:"Account created" ~buttons
- dbh hostid q ("An account was created for " ^ username ^ ".")
+ r dbh hostid q ("An account was created for " ^ username ^ ".")
let () =
register_script ~restrict:[CanManageUsers] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: create_user_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: create_user_form.ml,v 1.3 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "create_user_form.html" in
+ let template = get_template r dbh hostid "create_user_form.html" in
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: dead_ends.ml,v 1.3 2006/03/27 18:09:46 rich Exp $
+ * $Id: dead_ends.ml,v 1.4 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "dead_ends.html" in
+ let template = get_template r dbh hostid "dead_ends.html" in
let rows =
PGSQL(dbh)
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_contact.ml,v 1.6 2006/07/26 13:12:10 rich Exp $
+ * $Id: delete_contact.ml,v 1.7 2006/12/06 09:46:57 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
PGOCaml.commit dbh;
ok ~title:"Contact form(s) deleted" ~buttons:[ok_button "/_bin/contacts.cmo"]
- dbh hostid q "Those contact form(s) were deleted."
+ r dbh hostid q "Those contact form(s) were deleted."
let () =
register_script ~restrict:[CanManageContacts] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_contact_form.ml,v 1.4 2006/07/26 13:12:10 rich Exp $
+ * $Id: delete_contact_form.ml,v 1.5 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid { hostname = hostname } _ =
- let template = get_template dbh hostid "delete_contact_form.html" in
+ let template = get_template r dbh hostid "delete_contact_form.html" in
(* We can delete multiple contact forms from this script, which is
* quite unusual.
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_file.ml,v 1.10 2006/03/27 18:09:46 rich Exp $
+ * $Id: delete_file.ml,v 1.11 2006/12/06 09:46:57 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
(* Done. *)
let buttons = [ ok_button "/_files" ] in
ok ~title:"File deleted" ~buttons
- dbh hostid q "File was deleted successfully."
+ r dbh hostid q "File was deleted successfully."
) else
q#redirect ("http://" ^ hostname ^ "/_files")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_file_form.ml,v 1.8 2006/03/27 18:09:46 rich Exp $
+ * $Id: delete_file_form.ml,v 1.9 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "delete_file_form.html" in
+ let template = get_template r dbh hostid "delete_file_form.html" in
let id = Int32.of_string (q#param "id") in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_image.ml,v 1.10 2006/03/27 18:09:46 rich Exp $
+ * $Id: delete_image.ml,v 1.11 2006/12/06 09:46:57 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
(* Done. *)
let buttons = [ ok_button "/_images" ] in
ok ~title:"Image deleted" ~buttons
- dbh hostid q "Image was deleted successfully."
+ r dbh hostid q "Image was deleted successfully."
) else
q#redirect ("http://" ^ hostname ^ "/_images")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_image_form.ml,v 1.8 2006/03/27 18:09:46 rich Exp $
+ * $Id: delete_image_form.ml,v 1.9 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "delete_image_form.html" in
+ let template = get_template r dbh hostid "delete_image_form.html" in
let id = Int32.of_string (q#param "id") in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_macro.ml,v 1.1 2006/07/26 16:26:43 rich Exp $
+ * $Id: delete_macro.ml,v 1.2 2006/12/06 09:46:57 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
PGOCaml.commit dbh;
ok ~title:"Macro deleted" ~buttons:[ok_button "/_bin/edit_macros.cmo"]
- dbh hostid q "That macro was deleted."
+ r dbh hostid q "That macro was deleted."
let () =
register_script ~restrict:[CanEditMacros] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_macro_form.ml,v 1.1 2006/07/26 16:26:43 rich Exp $
+ * $Id: delete_macro_form.ml,v 1.2 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid { hostname = hostname } _ =
- let template = get_template dbh hostid "delete_macro_form.html" in
+ let template = get_template r dbh hostid "delete_macro_form.html" in
(* We can delete multiple macros from this script, which is
* quite unusual.
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_user.ml,v 1.7 2006/07/26 13:12:10 rich Exp $
+ * $Id: delete_user.ml,v 1.8 2006/12/06 09:46:57 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
match self with
| User (id, _, _, _) when id = userid ->
error ~back_button:true ~title:"Delete own account"
- dbh hostid q "You cannot delete your own user account.";
+ r dbh hostid q "You cannot delete your own user account.";
return ()
| _ -> () in
PGOCaml.commit dbh;
ok ~title:"Account deleted" ~buttons:[ok_button "/_users"]
- dbh hostid q "That user account was deleted."
+ r dbh hostid q "That user account was deleted."
let () =
register_script ~restrict:[CanManageUsers] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: delete_user_form.ml,v 1.5 2006/03/27 18:09:46 rich Exp $
+ * $Id: delete_user_form.ml,v 1.6 2006/12/06 09:46:57 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
open Cocanwiki_ok
let run r (q : cgi) dbh hostid _ self =
- let template = get_template dbh hostid "delete_user_form.html" in
+ let template = get_template r dbh hostid "delete_user_form.html" in
let userid = Int32.of_string (q#param "userid") in
template#set "userid" (Int32.to_string userid);
match self with
| User (id, _, _, _) when id = userid ->
error ~back_button:true ~title:"Delete own account"
- dbh hostid q "You cannot delete your own user account.";
+ r dbh hostid q "You cannot delete your own user account.";
return ()
| _ -> () in
(* 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.10 2006/03/27 18:09:46 rich Exp $
+ * $Id: diff.ml,v 1.11 2006/12/06 09:46:57 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
open Cocanwiki_diff
let run r (q : cgi) dbh hostid _ user =
- let template = get_template dbh hostid "diff.html" in
+ let template = get_template r dbh hostid "diff.html" in
let page = q#param "page" in
let page = if page = "" then "index" else page in
(* 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.37 2006/08/17 09:11:31 rich Exp $
+ * $Id: edit.ml,v 1.38 2006/12/06 09:46:57 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
open Cocanwiki_pages
let run r (q : cgi) dbh hostid {hostname = hostname} user =
- let template = get_template dbh hostid "edit.html" in
- let template_conflict = get_template dbh hostid "edit_conflict.html" in
- let template_email = get_template dbh hostid "edit_page_email.txt" in
+ let template = get_template r dbh hostid "edit.html" in
+ let template_conflict = get_template r dbh hostid "edit_conflict.html" in
+ let template_email = get_template r dbh hostid "edit_page_email.txt" in
(* Workaround bugs in IE, specifically lack of support for <button>
* elements.
q#redirect ("http://" ^ hostname ^ "/" ^ url)
| Wikilib.GenURL_TooShort | Wikilib.GenURL_BadURL ->
error ~back_button:true ~title:"Bad page name"
- dbh hostid q
+ r dbh hostid q
"The page name supplied is too short or invalid.";
return ()
);
with
SaveURLError ->
error ~back_button:true ~title:"Page exists"
- dbh hostid q ("While you were editing that page, it looks " ^
- "like another user created the same page.");
+ r dbh hostid q
+ ("While you were editing that page, it looks " ^
+ "like another user created the same page.");
return ()
| SaveConflict (new_version, old_version, url, css) ->
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_contact.ml,v 1.5 2006/03/27 18:09:46 rich Exp $
+ * $Id: edit_contact.ml,v 1.6 2006/12/06 09:46:57 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
if name = "" then (
error ~back_button:true ~title:"Name field missing"
- dbh hostid q "You must name your contact form.";
+ r dbh hostid q "You must name your contact form.";
return ()
);
if subject = "" then (
error ~back_button:true ~title:"Subject line missing"
- dbh hostid q
+ r dbh hostid q
"You must give a subject line, which appears on contact emails.";
return ()
);
if emails = [] then (
error ~back_button:true ~title:"No email addresses"
- dbh hostid q
+ r dbh hostid q
("There are no email addresses listed for this contact form. You " ^
"must list at least one valid email address.");
return ()
Template.StdPages.method_ = None;
Template.StdPages.params = [ "id", Int32.to_string id ] } ] in
ok ~title:"Contact form edited" ~buttons
- dbh hostid q "The contact form was edited."
+ r dbh hostid q "The contact form was edited."
let () =
register_script ~restrict:[CanManageContacts] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_contact_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: edit_contact_form.ml,v 1.3 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "edit_contact_form.html" in
+ let template = get_template r dbh hostid "edit_contact_form.html" in
let id = Int32.of_string (q#param "id") in
template#set "id" (Int32.to_string id);
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_file.ml,v 1.4 2006/03/27 18:09:46 rich Exp $
+ * $Id: edit_file.ml,v 1.5 2006/12/06 09:46:57 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 buttons = [ ok_button "/_files" ] in
ok ~title:"Description fields updated" ~buttons
- dbh hostid q "The description fields were updated."
+ r dbh hostid q "The description fields were updated."
let () =
register_script ~restrict:[CanEdit] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_file_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: edit_file_form.ml,v 1.3 2006/12/06 09:46:57 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
open Cocanwiki_date
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "edit_file_form.html" in
+ let template = get_template r dbh hostid "edit_file_form.html" in
let id = Int32.of_string (q#param "id") in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_host_css.ml,v 1.6 2006/03/27 18:09:46 rich Exp $
+ * $Id: edit_host_css.ml,v 1.7 2006/12/06 09:46:57 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
open Cocanwiki_ok
open Cocanwiki_strings
+type stylesheet = Global | Ie6_fixes | Ie7_fixes
+let string_of_stylesheet = function
+ | Global -> "global"
+ | Ie6_fixes -> "ie6_fixes"
+ | Ie7_fixes -> "ie7_fixes"
+let stylesheet_of_string = function
+ | "global" -> Global
+ | "ie6_fixes" -> Ie6_fixes
+ | "ie7_fixes" -> Ie7_fixes
+ | str -> failwith ("stylesheet_of_string: unknown stylesheet: " ^ str)
+
let run r (q : cgi) dbh hostid _ _ =
- let css = q#param "css" in
+ (* Which stylesheet to edit? *)
+ let css = if q#param_exists "css" then q#param "css" else "global" in
+ let css = stylesheet_of_string css in
- let css = if string_is_whitespace css then None else Some css in
+ (* Get the updated content. *)
+ let content = q#param "content" in
+ let content = if string_is_whitespace content then None else Some content in
(* XXX We should version the global stylesheet. However this requires
* some fairly non-trivial coding.
*)
- PGSQL(dbh) "update hosts set css = $?css where id = $hostid";
+ (match css with
+ | Global ->
+ PGSQL(dbh)
+ "update hosts set css = $?content where id = $hostid"
+ | Ie6_fixes ->
+ PGSQL(dbh)
+ "update hosts set ie6_fixes_css = $?content where id = $hostid"
+ | Ie7_fixes ->
+ PGSQL(dbh)
+ "update hosts set ie7_fixes_css = $?content where id = $hostid"
+ );
PGOCaml.commit dbh;
{ Template.StdPages.label = "Edit stylesheet again";
Template.StdPages.link = "/_bin/edit_host_css_form.cmo";
Template.StdPages.method_ = None;
- Template.StdPages.params = [] }
+ Template.StdPages.params = [ "css", string_of_stylesheet css ] }
] in
- ok ~title:"Global stylesheet changed" ~buttons
- dbh hostid q
+ ok ~title:"Stylesheet changed" ~buttons
+ r dbh hostid q
("The stylesheet was changed successfully. " ^
"Note: You must RELOAD the page to see changes to stylesheets.")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_host_css_form.ml,v 1.4 2006/03/27 18:09:46 rich Exp $
+ * $Id: edit_host_css_form.ml,v 1.5 2006/12/06 09:46:57 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
open Cocanwiki
open Cocanwiki_template
+type stylesheet = Global | Ie6_fixes | Ie7_fixes
+let string_of_stylesheet = function
+ | Global -> "global"
+ | Ie6_fixes -> "ie6_fixes"
+ | Ie7_fixes -> "ie7_fixes"
+let stylesheet_of_string = function
+ | "global" -> Global
+ | "ie6_fixes" -> Ie6_fixes
+ | "ie7_fixes" -> Ie7_fixes
+ | str -> failwith ("stylesheet_of_string: unknown stylesheet: " ^ str)
+
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "edit_host_css_form.html" in
+ let template = get_template r dbh hostid "edit_host_css_form.html" in
- let rows = PGSQL(dbh) "select css from hosts where id = $hostid" in
+ (* Which stylesheet to edit? *)
+ let css = if q#param_exists "css" then q#param "css" else "global" in
+ let css = stylesheet_of_string css in
- let css =
- match rows with
- | [ None ] -> ""
- | [ Some css ] -> css
- | _ -> assert false in
+ let content =
+ match css with
+ | Global ->
+ PGSQL(dbh) "select css from hosts where id = $hostid"
+ | Ie6_fixes ->
+ PGSQL(dbh) "select ie6_fixes_css from hosts where id = $hostid"
+ | Ie7_fixes ->
+ PGSQL(dbh) "select ie7_fixes_css from hosts where id = $hostid" in
+ let content =
+ match content with
+ | [Some c] -> c
+ | _ -> "" in
- template#set "css" css;
+ template#set "css" (string_of_stylesheet css);
+ template#set "content" content;
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_host_settings.ml,v 1.13 2006/08/14 11:36:50 rich Exp $
+ * $Id: edit_host_settings.ml,v 1.14 2006/12/06 09:46:57 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
(* Finish off. *)
ok ~title:"Global settings updated"
~buttons:[ok_button "/_bin/host_menu.cmo"]
- dbh hostid q "The global settings were updated."
+ r dbh hostid q "The global settings were updated."
let () =
register_script ~restrict:[CanManageSite] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_host_settings_form.ml,v 1.9 2006/08/14 11:36:50 rich Exp $
+ * $Id: edit_host_settings_form.ml,v 1.10 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "edit_host_settings_form.html" in
+ let template = get_template r dbh hostid "edit_host_settings_form.html" in
(* List of themes. *)
let rows =
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_image.ml,v 1.4 2006/03/27 18:09:46 rich Exp $
+ * $Id: edit_image.ml,v 1.5 2006/12/06 09:46:57 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
(* Check some ALT text was supplied. *)
if string_is_whitespace alt then (
error ~title:"Missing Alt text" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("You must supply Alt text describing the image. This is required " ^
"by accessibility laws and to allow search engines to discover the " ^
"content of images.");
let buttons = [ ok_button "/_images" ] in
ok ~title:"Description fields updated" ~buttons
- dbh hostid q "The description fields were updated."
+ r dbh hostid q "The description fields were updated."
let () =
register_script ~restrict:[CanEdit] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_image_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: edit_image_form.ml,v 1.3 2006/12/06 09:46:57 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
open Cocanwiki_date
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "edit_image_form.html" in
+ let template = get_template r dbh hostid "edit_image_form.html" in
let id = Int32.of_string (q#param "id") in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_macro.ml,v 1.1 2006/07/26 16:26:43 rich Exp $
+ * $Id: edit_macro.ml,v 1.2 2006/12/06 09:46:57 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 buttons = [ ok_button "/_bin/edit_macros.cmo" ] in
ok ~title:"Macro edited" ~buttons
- dbh hostid q "The macro was edited."
+ r dbh hostid q "The macro was edited."
let () =
register_script ~restrict:[CanEditMacros] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_macro_form.ml,v 1.1 2006/07/26 16:26:43 rich Exp $
+ * $Id: edit_macro_form.ml,v 1.2 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "edit_macro_form.html" in
+ let template = get_template r dbh hostid "edit_macro_form.html" in
let name = q#param "name" in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_macros.ml,v 1.1 2006/07/26 16:26:43 rich Exp $
+ * $Id: edit_macros.ml,v 1.2 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "edit_macros.html" in
+ let template = get_template r dbh hostid "edit_macros.html" in
(* Get a list of the macros for this host. *)
let macros =
(* 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.24 2006/08/17 09:11:31 rich Exp $
+ * $Id: edit_page_css.ml,v 1.25 2006/12/06 09:46:57 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.StdPages.method_ = None;
Template.StdPages.params = [ "page", page ] } ] in
ok ~title:"Stylesheet changed" ~buttons
- dbh hostid q
+ r dbh hostid q
("The stylesheet was changed successfully. " ^
"Note: You must RELOAD the page to see changes to stylesheets.")
(* 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_form.ml,v 1.8 2006/03/27 19:10:29 rich Exp $
+ * $Id: edit_page_css_form.ml,v 1.9 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "edit_page_css_form.html" in
+ let template = get_template r dbh hostid "edit_page_css_form.html" in
let page = q#param "page" in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_sitemenu.ml,v 1.12 2006/07/26 13:12:10 rich Exp $
+ * $Id: edit_sitemenu.ml,v 1.13 2006/12/06 09:46:57 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 model_t = (string * string) list (* label, url *)
let run r (q : cgi) dbh hostid { hostname = hostname } user=
- let template = get_template dbh hostid "edit_sitemenu.html" in
+ let template = get_template r dbh hostid "edit_sitemenu.html" in
(* Workaround bugs in IE, specifically lack of support for <button>
* elements.
let buttons = [ ok_button "/_bin/host_menu.cmo" ] in
ok ~title:"Saved" ~buttons
- dbh hostid q "The site menu was saved."
+ r dbh hostid q "The site menu was saved."
);
no_errors
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_user.ml,v 1.13 2006/07/26 16:34:18 rich Exp $
+ * $Id: edit_user.ml,v 1.14 2006/12/06 09:46:57 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
if original_name <> name then (
if name = "" then (
error ~back_button:true ~title:"Bad username"
- dbh hostid q "The username you gave is empty.";
+ r dbh hostid q "The username you gave is empty.";
return ()
);
(match rows with
| [Some 1l] ->
error ~back_button:true ~title:"Username already taken"
- dbh hostid q
+ r dbh hostid q
("That username has already been taken by another user.");
return ()
| _ -> ()
(match can_manage_users, self with
| false, User (id, _, _, _) when id = userid ->
error ~back_button:true ~title:"Remove manage users from self"
- dbh hostid q
+ r dbh hostid q
("You tried to remove 'Manage users' permission from yourself. " ^
"You can't do this. You'll have to do it from another " ^
"user account.");
let buttons = [ ok_button "/_users" ] in
ok ~buttons ~title:"Saved"
- dbh hostid q "Changes were saved."
+ r dbh hostid q "Changes were saved."
let () =
register_script ~restrict:[CanManageUsers] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: edit_user_form.ml,v 1.11 2006/07/26 16:34:18 rich Exp $
+ * $Id: edit_user_form.ml,v 1.12 2006/12/06 09:46:57 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
open Cocanwiki_date
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "edit_user_form.html" in
+ let template = get_template r dbh hostid "edit_user_form.html" in
let userid = Int32.of_string (q#param "userid") in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: email_change.ml,v 1.4 2006/03/27 19:10:29 rich Exp $
+ * $Id: email_change.ml,v 1.5 2006/12/06 09:46:57 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
| [ row ] -> row
| [] ->
error ~title:"Already verified"
- dbh hostid q
+ r dbh hostid q
("It looks like you have already verified this email address.");
return ()
| _ -> assert false in
PGOCaml.commit dbh;
ok ~title:"Email address verified"
- dbh hostid q "Thank you for verifying your new email address."
+ r dbh hostid q "Thank you for verifying your new email address."
let () =
register_script run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: files.ml,v 1.9 2006/03/27 19:10:29 rich Exp $
+ * $Id: files.ml,v 1.10 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "files.html" in
+ let template = get_template r dbh hostid "files.html" in
let deleted = q#param_true "deleted" in
template#conditional "deleted" deleted;
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: forgot_password.ml,v 1.12 2006/08/18 10:16:35 rich Exp $
+ * $Id: forgot_password.ml,v 1.13 2006/12/06 09:46:57 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
if name = "" then (
error ~back_button:true ~title:"No username or email address"
- dbh hostid q "You didn't give a username or email address";
+ r dbh hostid q "You didn't give a username or email address";
return ()
);
Unix.sleep 10;
error ~back_button:true ~title:"Nothing known"
- dbh hostid q
+ r dbh hostid q
"Sorry, don't know anyone with that name or email address.";
return () in
let buttons = [ ok_button "/_login" ] in
ok ~buttons ~title:"Password sent by email"
- dbh hostid q
+ r dbh hostid q
("Your password was sent by email. If you don't receive the password " ^
"within an hour, please notify the site's administrator.")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: forgot_password_form.ml,v 1.5 2006/03/27 18:09:46 rich Exp $
+ * $Id: forgot_password_form.ml,v 1.6 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "forgot_password_form.html" in
+ let template = get_template r dbh hostid "forgot_password_form.html" in
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: history.ml,v 1.11 2006/03/27 19:10:29 rich Exp $
+ * $Id: history.ml,v 1.12 2006/12/06 09:46:57 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
open Cocanwiki_date
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "history.html" in
+ let template = get_template r dbh hostid "history.html" in
let page = q#param "page" in
let page = if page = "" then "index" else page in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: history_rss.ml,v 1.4 2006/03/27 19:10:29 rich Exp $
+ * $Id: history_rss.ml,v 1.5 2006/12/06 09:46:57 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
open Cocanwiki_date
let run r (q : cgi) dbh hostid {hostname = hostname} _ =
- let template = get_template dbh hostid "history_rss.xml" in
+ let template = get_template r dbh hostid "history_rss.xml" in
let page = q#param "page" in
let page = if page = "" then "index" else page in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: host_menu.ml,v 1.12 2006/08/14 11:36:50 rich Exp $
+ * $Id: host_menu.ml,v 1.13 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid host user =
- let template = get_template dbh hostid "host_menu.html" in
+ let template = get_template r dbh hostid "host_menu.html" in
(* Get user's specific permissions. *)
let can_manage_users = can_manage_users host user in
(* Get lots of host-specific stuff from the database. *)
let rows =
PGSQL(dbh) "nullable-results"
- "select h.canonical_hostname, h.css is not null, h.edit_anon,
+ "select h.canonical_hostname,
+ h.css is not null,
+ h.ie6_fixes_css is not null, h.ie7_fixes_css is not null,
+ h.edit_anon,
h.create_account_anon, h.theme_css is not null,
t.name, t.description, h.feedback_email, h.mailing_list,
h.search_box, h.navigation, h.view_anon,
from hosts h left outer join themes t on h.theme_css = t.theme_css
where h.id = $hostid" in
- let canonical_hostname, has_global_css, edit_anon, create_account_anon,
+ let canonical_hostname, has_global_css,
+ has_ie6_fixes_css, has_ie7_fixes_css,
+ edit_anon, create_account_anon,
has_theme_css, theme_name, theme_description, has_feedback_email,
feedback_email, mailing_list, search_box, navigation, view_anon,
has_brand, brand, brand_tagline, brand_description,
ie_imagetoolbar_no, global_noodp =
match rows with
[ Some canonical_hostname, Some has_global_css,
+ Some has_ie6_fixes_css, Some has_ie7_fixes_css,
Some edit_anon, Some create_account_anon, Some has_theme_css,
theme_name, theme_description,
feedback_email,
match brand_tagline with None -> "" | Some s -> s in
let brand_description =
match brand_description with None -> "" | Some s -> s in
- canonical_hostname, has_global_css, edit_anon, create_account_anon,
+ canonical_hostname, has_global_css,
+ has_ie6_fixes_css, has_ie7_fixes_css,
+ edit_anon, create_account_anon,
has_theme_css, theme_name, theme_description, has_feedback_email,
feedback_email, mailing_list, search_box, navigation, view_anon,
has_brand, brand, brand_tagline, brand_description,
template#set "canonical_hostname" canonical_hostname;
template#conditional "has_global_css" has_global_css;
+ template#conditional "has_ie6_fixes_css" has_ie6_fixes_css;
+ template#conditional "has_ie7_fixes_css" has_ie7_fixes_css;
template#conditional "edit_anon" edit_anon;
template#conditional "create_account_anon" create_account_anon;
template#conditional "has_theme_css" has_theme_css;
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: hoststyle.ml,v 1.8 2006/03/27 19:10:29 rich Exp $
+ * $Id: hoststyle.ml,v 1.9 2006/12/06 09:46:57 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
open Cocanwiki
open Cocanwiki_template
+type stylesheet = Global | Ie6_fixes | Ie7_fixes
+let string_of_stylesheet = function
+ | Global -> "global"
+ | Ie6_fixes -> "ie6_fixes"
+ | Ie7_fixes -> "ie7_fixes"
+let stylesheet_of_string = function
+ | "global" -> Global
+ | "ie6_fixes" -> Ie6_fixes
+ | "ie7_fixes" -> Ie7_fixes
+ | str -> failwith ("stylesheet_of_string: unknown stylesheet: " ^ str)
+
let run r (q : cgi) dbh hostid _ _ =
- (* Get the CSS. *)
- let css = List.hd (PGSQL(dbh) "select css from hosts where id = $hostid") in
+ (* Which stylesheet to serve? *)
+ let css = if q#param_exists "css" then q#param "css" else "global" in
+ let css = stylesheet_of_string css in
+
+ (* Get the CSS itself. *)
+ let css =
+ match css with
+ | Global ->
+ PGSQL(dbh) "select css from hosts where id = $hostid"
+ | Ie6_fixes ->
+ PGSQL(dbh) "select ie6_fixes_css from hosts where id = $hostid"
+ | Ie7_fixes ->
+ PGSQL(dbh) "select ie7_fixes_css from hosts where id = $hostid" in
let css =
match css with
- | None -> ""
- | Some css -> css in
+ | [Some css] -> css
+ | _ -> "" in
(* It's crucial, for speed of page delivery and rendering, to have
* an expires header for CSS. Even though this means that occasionally
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: images.ml,v 1.10 2006/03/28 16:24:07 rich Exp $
+ * $Id: images.ml,v 1.11 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "images.html" in
+ let template = get_template r dbh hostid "images.html" in
let deleted = q#param_true "deleted" in
template#conditional "deleted" deleted;
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: invite_user.ml,v 1.9 2006/07/31 09:49:43 rich Exp $
+ * $Id: invite_user.ml,v 1.10 2006/12/06 09:46:57 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 buttons = [ ok_button "/_users" ] in
ok ~buttons ~title:"Invitation emails sent"
- dbh hostid q "We sent invitations emails to those address(es)."
+ r dbh hostid q "We sent invitations emails to those address(es)."
let () =
register_script ~restrict:[CanManageUsers] ~anonymous:false run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: invite_user_confirm.ml,v 1.8 2006/07/31 09:49:43 rich Exp $
+ * $Id: invite_user_confirm.ml,v 1.9 2006/12/06 09:46:57 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
| [ None, userid ] -> None, userid
| [] ->
error ~title:"Already signed up"
- dbh hostid q "It looks like you have already used your invitation.";
+ r dbh hostid q
+ "It looks like you have already used your invitation.";
return ()
| _ -> assert false in
if password1 = "" || password2 = "" then (
error ~back_button:true ~title:"Bad password"
- dbh hostid q "The password you gave is empty.";
+ r dbh hostid q "The password you gave is empty.";
return ()
);
if password1 <> password2 then (
error ~back_button:true ~title:"Passwords don't match"
- dbh hostid q "The two passwords you gave aren't identical.";
+ r dbh hostid q "The two passwords you gave aren't identical.";
return ()
);
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: invite_user_confirm_form.ml,v 1.5 2006/03/28 13:20:00 rich Exp $
+ * $Id: invite_user_confirm_form.ml,v 1.6 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "invite_user_confirm_form.html" in
+ let template = get_template r dbh hostid "invite_user_confirm_form.html" in
(* Get the invite ID. *)
let invite = q#param "p" in
| [username] -> username
| [] ->
error ~title:"Already signed up"
- dbh hostid q
+ r dbh hostid q
("It looks like you have already used your invitation. If " ^
"you cannot get to your account, please contact the " ^
"administrator.");
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: invite_user_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: invite_user_form.ml,v 1.3 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "invite_user_form.html" in
+ let template = get_template r dbh hostid "invite_user_form.html" in
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: largest_pages.ml,v 1.6 2006/03/28 16:24:07 rich Exp $
+ * $Id: largest_pages.ml,v 1.7 2006/12/06 09:46:57 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 overhead = 2 (* Number of seconds to open connection + render page. *)
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "largest_pages.html" in
+ let template = get_template r dbh hostid "largest_pages.html" in
(* Grab the pages from the database, ordered by size.
* NB. At the moment we count the size of the markup, which is only an
(* 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.14 2006/08/16 15:27:02 rich Exp $
+ * $Id: cocanwiki.ml,v 1.15 2006/12/06 09:46:57 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
try Request.hostname r
with Not_found ->
error ~back_button:true
- ~title:"Browser problem" dbh (-1l) q
+ ~title:"Browser problem" r dbh (-1l) q
("Your browser didn't send a \"Host\" header as part of " ^
"the HTTP request. Unfortunately this web server " ^
"cannot handle HTTP requests without a \"Host\" " ^
create_account_anon
| [] ->
error ~back_button:true
- ~title:"Unknown website" dbh (-1l) q
+ ~title:"Unknown website" r dbh (-1l) q
("No website called \"" ^ hostname ^ "\" can be found. " ^
"If you are the administrator of this site, check that " ^
"the hostname is listed in the \"hostnames\" table " ^
) else
error ~back_button:true
~title:"Access denied"
- dbh hostid q
+ r dbh hostid q
"You do not have permission to access this part of the site."
);
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_ok.ml,v 1.3 2005/11/24 14:54:15 rich Exp $
+ * $Id: cocanwiki_ok.ml,v 1.4 2006/12/06 09:46:57 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
* Also have some standard buttons around.
*)
let error ?cookie ?cookies ?title ?(icon = "/_graphics/error.png")
- ?icon_alt ?back_button ?close_button dbh hostid q message =
- let template = get_template dbh hostid "ok_error.html" in
+ ?icon_alt ?back_button ?close_button r dbh hostid q message =
+ let template = get_template r dbh hostid "ok_error.html" in
(* Set the status so scripts can determine if the request failed. *)
Request.set_status q#request cHTTP_BAD_REQUEST;
Template.StdPages.error ?cookie ?cookies ~template
?title ~icon ?icon_alt ?back_button ?close_button q message
let ok ?cookie ?cookies ?title ?(icon = "/_graphics/ok.png")
- ?icon_alt ?back_button ?close_button ?buttons dbh hostid q message =
- let template = get_template dbh hostid "ok_error.html" in
+ ?icon_alt ?back_button ?close_button ?buttons r dbh hostid q message =
+ let template = get_template r dbh hostid "ok_error.html" in
Template.StdPages.ok ?cookie ?cookies ~template
?title ~icon ?icon_alt ?back_button ?close_button ?buttons q message
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_template.ml,v 1.11 2006/08/16 15:27:02 rich Exp $
+ * $Id: cocanwiki_template.ml,v 1.12 2006/12/06 09:46:57 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
open Unix
+open ExtString
+
+open Apache
+
open Cocanwiki_files
open Cocanwiki_strings
let { tm_year = year } = gmtime (time ())
let year = year + 1900
+(* Sniff for MSIE of a particular version. *)
+let is_msie_version user_agent version =
+ try
+ let index = String.find user_agent "MSIE " in
+ let index = index + 5 in
+ String.length user_agent > index && user_agent.[index] = version
+ with
+ Invalid_string -> false
+
(* Cache of precompiled templates, arranged by full path. *)
let cache = Hashtbl.create 32
Hashtbl.replace cache path (template, mtime);
template
-let get_template ?page dbh hostid filename =
+let get_template ?page r dbh hostid filename =
let template = _get_template filename in
if hostid > 0l then (
let rows =
PGSQL(dbh) "nullable-results"
"select h.theme_css, h.css is not null,
+ h.ie6_fixes_css is not null, h.ie7_fixes_css is not null,
p.name, p.url, h.search_box,
h.brand, h.brand_tagline, h.brand_description,
h.pagebug, h.ie_imagetoolbar_no, h.global_noodp
from hosts h left outer join powered_by p on h.powered_by = p.id
where h.id = $hostid" in
- let theme_css, has_host_css, powered_by_name, powered_by_url, search_box,
+ let theme_css, has_host_css, has_ie6_fixes_css, has_ie7_fixes_css,
+ powered_by_name, powered_by_url, search_box,
brand, brand_tagline, brand_description, pagebug, ie_imagetoolbar_no,
global_noodp =
match rows with
| Some true -> true
| _ -> false in
+ (* Send the IE6/7 fixes header only to browsers claiming to be MSIE.
+ * A browser such as Opera which claims to be MSIE will see the header
+ * but ignore it because it is surrounded by comment code to defend
+ * against browsers which aren't really MSIE.
+ *)
+ let ua = lazy (
+ try Table.get (Request.headers_in r) "User-Agent"
+ with Not_found -> ""
+ ) in
+
+ let has_ie6_fixes_css =
+ has_ie6_fixes_css = Some true && is_msie_version (Lazy.force ua) '6' in
+
+ let has_ie7_fixes_css =
+ has_ie7_fixes_css = Some true && is_msie_version (Lazy.force ua) '7' in
+
let powered_by_name, powered_by_url =
match powered_by_name, powered_by_url with
| None, None ->
template#set "theme_css" theme_css;
template#conditional "has_host_css" has_host_css;
+ template#conditional "has_ie6_fixes_css" has_ie6_fixes_css;
+ template#conditional "has_ie7_fixes_css" has_ie7_fixes_css;
template#set "powered_by_name" powered_by_name;
template#set "powered_by_url" powered_by_url;
template#conditional "search_box" search_box;
else (* if we have no hostid *) (
template#set "theme_css" "/_css/standard.css";
template#conditional "has_host_css" false;
+ template#conditional "has_ie6_fixes_css" false;
+ template#conditional "has_ie7_fixes_css" false;
template#set "powered_by_name" (Cocanwiki_version.package ^ " " ^
Cocanwiki_version.version);
template#set "powered_by_url" "http://sandbox.merjis.com/";
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: cocanwiki_template.mli,v 1.2 2006/03/27 16:43:44 rich Exp $
+ * $Id: cocanwiki_template.mli,v 1.3 2006/12/06 09:46:57 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
* Boston, MA 02111-1307, USA.
*)
+open Apache
+
(** Get template from filename, with no host-specific substitutions. *)
val _get_template : string -> Template.template
(** Get template from filename, with host-specific substitutions.
* The special ~page parameter is only used by [page.ml].
*)
-val get_template : ?page:string -> PGOCaml.pa_pg_data PGOCaml.t -> int32 -> string -> Template.template
+val get_template : ?page:string -> Request.t -> PGOCaml.pa_pg_data PGOCaml.t -> int32 -> string -> Template.template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: links.ml,v 1.5 2006/03/28 16:24:07 rich Exp $
+ * $Id: links.ml,v 1.6 2006/12/06 09:46:57 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
* simple machine-parsable text file.
*)
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "links.txt" in
+ let template = get_template r dbh hostid "links.txt" in
if q#param_exists "page" then (
let page = q#param "page" in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: login.ml,v 1.11 2006/03/28 16:24:07 rich Exp $
+ * $Id: login.ml,v 1.12 2006/12/06 09:46:57 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
error
~title:"Bad name or password"
~back_button:true
- dbh hostid q "The name or password was wrong.";
+ r dbh hostid q "The name or password was wrong.";
return ()
| [ row ] -> row
| _ -> assert false in
) else [ ok_button ] in
ok ~title:"Logged in" ~buttons ~cookie
- dbh hostid q
+ r dbh hostid q
("Welcome " ^ username ^ "." ^
if force_password_change then " Please change your password now."
else "")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: login_form.ml,v 1.8 2006/07/26 13:19:49 rich Exp $
+ * $Id: login_form.ml,v 1.9 2006/12/06 09:46:57 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 run r (q : cgi) dbh hostid
{ create_account_anon = create_account_anon } _ =
- let template = get_template dbh hostid "login_form.html" in
+ let template = get_template r dbh hostid "login_form.html" in
let redirect = try q#param "redirect" with Not_found -> "" in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: logout.ml,v 1.9 2006/03/28 16:24:07 rich Exp $
+ * $Id: logout.ml,v 1.10 2006/12/06 09:46:57 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 cookie = Cookie.cookie "auth" "none" ~path:"/" ~expires in
ok ~title:"Logged out" ~buttons:[ok_button "/"] ~cookie
- dbh hostid q "You have been logged out."
+ r dbh hostid q "You have been logged out."
let () =
register_script run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mail_import.ml,v 1.16 2006/08/17 09:11:31 rich Exp $
+ * $Id: mail_import.ml,v 1.17 2006/12/06 09:46:57 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 lines_re = Pcre.regexp "\\r?\\n"
let run r (q : cgi) dbh hostid _ user =
- let hdr_template = get_template dbh hostid "mail_import_header.txt" in
+ let hdr_template = get_template r dbh hostid "mail_import_header.txt" in
(* Overwrite old messages? *)
let overwrite = q#param_true "overwrite" in
with
Not_found ->
error ~back_button:true ~title:"No message"
- dbh hostid q "No message was uploaded.";
+ r dbh hostid q "No message was uploaded.";
return () in
(* Parse the message. *)
*)
if date = "" || inet_message_id = "" then (
error ~back_button:true ~title:"Headers missing"
- dbh hostid q
+ r dbh hostid q
"Date or Message-ID header missing. Cannot handle this message. ";
return ()
);
| [id] ->
if not overwrite then (
ok ~title:"Message exists"
- dbh hostid q "Message already imported";
+ r dbh hostid q "Message already imported";
return ()
);
Some id
(* Finish off. *)
ok ~title:"Imported"
- dbh hostid q ("Message " ^ inet_message_id ^ " was imported.")
+ r dbh hostid q ("Message " ^ inet_message_id ^ " was imported.")
let () =
register_script ~restrict:[CanImportMail] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mail_import_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: mail_import_form.ml,v 1.3 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "mail_import_form.html" in
+ let template = get_template r dbh hostid "mail_import_form.html" in
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mail_rebuild.ml,v 1.5 2006/07/27 16:46:55 rich Exp $
+ * $Id: mail_rebuild.ml,v 1.6 2006/12/06 09:46:57 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
(* Finish off. *)
ok ~title:"Rebuilt"
- dbh hostid q "Thread index rebuilt."
+ r dbh hostid q "Thread index rebuilt."
let () =
register_script ~restrict:[CanImportMail] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mailing_list_confirm.ml,v 1.7 2006/07/26 13:12:10 rich Exp $
+ * $Id: mailing_list_confirm.ml,v 1.8 2006/12/06 09:46:57 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
| [_] -> ()
| [] ->
error ~close_button:true ~title:"Email already confirmed"
- dbh hostid q
+ r dbh hostid q
"It looks like that email address has already been confirmed.";
return ()
| _ -> assert false);
(* Confirmed. *)
let buttons = [ ok_button "/" ] in
ok ~buttons ~title:"Confirmed"
- dbh hostid q ("Your email address has been confirmed. " ^
- "You are now on our mailing list.")
+ r dbh hostid q ("Your email address has been confirmed. " ^
+ "You are now on our mailing list.")
let () =
register_script ~restrict:[CanView] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mailing_list_form.ml,v 1.3 2006/03/27 18:09:46 rich Exp $
+ * $Id: mailing_list_form.ml,v 1.4 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "mailing_list_form.html" in
+ let template = get_template r dbh hostid "mailing_list_form.html" in
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mailing_list_send.ml,v 1.9 2006/07/31 09:49:43 rich Exp $
+ * $Id: mailing_list_send.ml,v 1.10 2006/12/06 09:46:57 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
open Cocanwiki_strings
let run r (q : cgi) dbh hostid { hostname = hostname } _ =
- let template = get_template dbh hostid "mailing_list_send.txt" in
+ let template = get_template r dbh hostid "mailing_list_send.txt" in
let email = trim (q#param "email") in
let name = trim (q#param "name") in
if email = "" then (
error ~title:"No email address" ~back_button:true
- dbh hostid q "You must give an email address.";
+ r dbh hostid q "You must give an email address.";
return ()
);
if registered then (
error ~title:"Email address already used" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("That email address is already on our mailing list. "^
"If you are not receiving mailing list messages, then you will " ^
"need to confirm that address. If you continue to have problems " ^
(* Finish up. *)
let buttons = [ ok_button "/" ] in
ok ~buttons ~title:"Confirmation email sent"
- dbh hostid q
+ r dbh hostid q
("Please check your email now. You have been sent a confirmation " ^
"email so we can verify the email address is yours. Click on the " ^
"first link in that email to confirm.")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mailing_list_unsubscribe.ml,v 1.4 2006/03/28 13:20:00 rich Exp $
+ * $Id: mailing_list_unsubscribe.ml,v 1.5 2006/12/06 09:46:57 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
(* Confirmed. *)
let buttons = [ ok_button "/" ] in
ok ~buttons ~title:"Unsubscribed"
- dbh hostid q "Your email address has been unsubscribed."
+ r dbh hostid q "Your email address has been unsubscribed."
let () =
register_script run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mailing_list_view.ml,v 1.4 2006/03/28 13:20:00 rich Exp $
+ * $Id: mailing_list_view.ml,v 1.5 2006/12/06 09:46:57 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
open Cocanwiki_date
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "mailing_list_view.html" in
- let template_csv = get_template dbh hostid "mailing_list_view.txt" in
+ let template = get_template r dbh hostid "mailing_list_view.html" in
+ let template_csv = get_template r dbh hostid "mailing_list_view.txt" in
(* CSV format? *)
let csv = q#param_true "csv" in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: new_page_form.ml,v 1.2 2006/03/27 18:09:46 rich Exp $
+ * $Id: new_page_form.ml,v 1.3 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "new_page_form.html" in
+ let template = get_template r dbh hostid "new_page_form.html" in
q#template template
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: orphans.ml,v 1.5 2006/03/28 16:24:07 rich Exp $
+ * $Id: orphans.ml,v 1.6 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "orphans.html" in
+ let template = get_template r dbh hostid "orphans.html" in
(* Start with the front page, the contents of the site menu and the
* special "copyright" page.
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: page.ml,v 1.58 2006/08/17 09:11:31 rich Exp $
+ * $Id: page.ml,v 1.59 2006/12/06 09:46:57 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 template_page_header =
- get_template ~page dbh hostid "page_header.html" in
- let template_page = get_template ~page dbh hostid "page.html" in
+ get_template ~page r dbh hostid "page_header.html" in
+ let template_page = get_template ~page r dbh hostid "page.html" in
(* This is the simpler template for 404 pages. *)
- let template_404_header = get_template dbh hostid "page_404_header.html" in
- let template_404 = get_template dbh hostid "page_404.html" in
+ let template_404_header = get_template r dbh hostid "page_404_header.html" in
+ let template_404 = get_template r dbh hostid "page_404.html" in
(* Host-specific fields. *)
let rows =
let rec loop page' i =
if i > max_redirect then (
error ~title:"Too many redirections" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("Too many redirects between pages. This may happen because " ^
"of a cycle of redirections.");
return ()
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: page_email_confirm.ml,v 1.5 2006/03/28 16:24:07 rich Exp $
+ * $Id: page_email_confirm.ml,v 1.6 2006/12/06 09:46:57 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
| [ row ] -> row
| [] ->
error ~close_button:true ~title:"Email already confirmed"
- dbh hostid q
+ r dbh hostid q
"It looks like that email address has already been confirmed.";
return ()
| _ -> assert false in
(* Confirmed. *)
let buttons = [ ok_button ("/" ^ page) ] in
ok ~buttons ~title:"Confirmed"
- dbh hostid q
+ r dbh hostid q
("Your email address has been confirmed. You will now receive " ^
"an email whenever that page is updated.")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: page_email_form.ml,v 1.4 2006/03/28 16:24:07 rich Exp $
+ * $Id: page_email_form.ml,v 1.5 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "page_email_form.html" in
+ let template = get_template r dbh hostid "page_email_form.html" in
let page = q#param "page" in
template#set "page" page;
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: page_email_send.ml,v 1.7 2006/07/31 09:49:43 rich Exp $
+ * $Id: page_email_send.ml,v 1.8 2006/12/06 09:46:57 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
open Cocanwiki_strings
let run r (q : cgi) dbh hostid { hostname = hostname } _ =
- let template = get_template dbh hostid "page_email_send.txt" in
+ let template = get_template r dbh hostid "page_email_send.txt" in
let page = q#param "page" in
let email = trim (q#param "email") in
if email = "" then (
error ~title:"No email address" ~back_button:true
- dbh hostid q "You must give an email address.";
+ r dbh hostid q "You must give an email address.";
return ()
);
if registered then (
error ~title:"Email address already used" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("That email address is already used for notifications from this page. "^
"If you are not receiving updates for this page, then you will " ^
"need to confirm that address. If you continue to have problems " ^
(* Finish up. *)
let buttons = [ ok_button ("/" ^ page) ] in
ok ~buttons ~title:"Confirmation email sent"
- dbh hostid q
+ r dbh hostid q
("Please check your email now. You have been sent a confirmation " ^
"email so we can verify the email address is yours. Click on the " ^
"first link in that email to confirm.")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: page_email_unsubscribe.ml,v 1.4 2006/03/28 16:24:08 rich Exp $
+ * $Id: page_email_unsubscribe.ml,v 1.5 2006/12/06 09:46:57 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
(* Confirmed. *)
let buttons = [ ok_button "/" ] in
ok ~buttons ~title:"Unsubscribed"
- dbh hostid q "Your email address has been unsubscribed."
+ r dbh hostid q "Your email address has been unsubscribed."
let () =
register_script run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: page_rss.ml,v 1.5 2006/07/27 16:46:55 rich Exp $
+ * $Id: page_rss.ml,v 1.6 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid {hostname = hostname} _ =
- let template = get_template dbh hostid "page_rss.xml" in
+ let template = get_template r dbh hostid "page_rss.xml" in
let page = q#param "page" in
let page = if page = "" then "index" else page in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: recent.ml,v 1.12 2006/03/28 16:24:08 rich Exp $
+ * $Id: recent.ml,v 1.13 2006/12/06 09:46:57 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 max_limit = 1000
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "recent.html" in
+ let template = get_template r dbh hostid "recent.html" in
(* Count the number of changes. *)
let count = Option.get (
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: recent_rss.ml,v 1.4 2006/03/28 16:24:08 rich Exp $
+ * $Id: recent_rss.ml,v 1.5 2006/12/06 09:46:57 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 limit = 30_l
let run r (q : cgi) dbh hostid {hostname = hostname} _ =
- let template = get_template dbh hostid "recent_rss.xml" in
+ let template = get_template r dbh hostid "recent_rss.xml" in
template#set "hostname" hostname;
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: recently_visited.ml,v 1.5 2006/03/28 18:40:50 rich Exp $
+ * $Id: recently_visited.ml,v 1.6 2006/12/06 09:46:57 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 limit = 50_l
let run r (q : cgi) dbh hostid _ user =
- let template = get_template dbh hostid "recently_visited.html" in
+ let template = get_template r dbh hostid "recently_visited.html" in
let userid =
match user with
(* 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.9 2006/08/14 11:36:50 rich Exp $
+ * $Id: rename_page.ml,v 1.10 2006/12/06 09:46:57 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
(* New title mustn't be empty string. *)
if new_title = "" then (
error ~back_button:true ~title:"Empty title not allowed"
- dbh hostid q "The new title cannot be empty.";
+ r dbh hostid q "The new title cannot be empty.";
return ()
);
| Wikilib.GenURL_OK url | Wikilib.GenURL_Duplicate url -> url
| Wikilib.GenURL_TooShort | Wikilib.GenURL_BadURL ->
error ~title:"Bad title" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("The new title for the page isn't valid. " ^
"It may be too short or it may not contain " ^
"enough alphabet letters.");
with
SaveURLError ->
error ~title:"Page exists"
- dbh hostid q
+ r dbh hostid q
("Another page with the same title exists. " ^
"If you tried to rename a page, then rename it back to the " ^
"original title, then you may see this error. This is a bug " ^
let buttons = [ ok_button ("/" ^ new_page) ] in
ok ~title:"Page renamed" ~buttons
- dbh hostid q "That page was renamed."
+ r dbh hostid q "That page was renamed."
let () =
register_script ~restrict:[CanEdit] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: rename_page_form.ml,v 1.3 2006/03/28 16:24:08 rich Exp $
+ * $Id: rename_page_form.ml,v 1.4 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "rename_page_form.html" in
+ let template = get_template r dbh hostid "rename_page_form.html" in
let page = q#param "page" 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.26 2006/08/17 09:11:31 rich Exp $
+ * $Id: restore.ml,v 1.27 2006/12/06 09:46:57 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
(* Done. *)
let buttons = [ ok_button ("/" ^ page) ] in
ok ~title:"Restored" ~buttons
- dbh hostid q "The old page was restored successfully."
+ r dbh hostid q "The old page was restored successfully."
) else
q#redirect ("http://" ^ hostname ^ "/" ^ page)
(* 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.13 2006/03/28 16:24:08 rich Exp $
+ * $Id: restore_form.ml,v 1.14 2006/12/06 09:46:57 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
open Cocanwiki_diff
let run r (q : cgi) dbh hostid _ user =
- let template = get_template dbh hostid "restore_form.html" in
+ let template = get_template r dbh hostid "restore_form.html" in
(* Parameters. *)
let page = q#param "page" in
if version = old_version then (
error ~back_button:true ~title:"Restoring live version"
- dbh hostid q "You seem to be trying to restore the live version.";
+ r dbh hostid q "You seem to be trying to restore the live version.";
return ()
);
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: search.ml,v 1.12 2006/08/16 15:27:02 rich Exp $
+ * $Id: search.ml,v 1.13 2006/12/06 09:46:57 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 split_words = Pcre.regexp "\\W+"
let run r (q : cgi) dbh hostid host user =
- let template = get_template dbh hostid "search.html" in
+ let template = get_template r dbh hostid "search.html" in
template#set "canonical_hostname" host.canonical_hostname;
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: send_feedback.ml,v 1.10 2006/07/31 09:49:43 rich Exp $
+ * $Id: send_feedback.ml,v 1.11 2006/12/06 09:46:57 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
open Cocanwiki_ok
let run r (q : cgi) dbh hostid {hostname = hostname} user =
- let template = get_template dbh hostid "send_feedback.txt" in
+ let template = get_template r dbh hostid "send_feedback.txt" in
if q#param_true "cancel" then
(* Request cancelled. *)
(* Confirm. *)
ok ~title:"Thank you for your feedback" ~buttons:[ok_button "/"]
- dbh hostid q "An email has been sent to the site administrators."
+ r dbh hostid q "An email has been sent to the site administrators."
let () =
register_script ~restrict:[CanView] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: send_feedback_form.ml,v 1.4 2006/03/27 18:09:46 rich Exp $
+ * $Id: send_feedback_form.ml,v 1.5 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "send_feedback_form.html" in
+ let template = get_template r dbh hostid "send_feedback_form.html" in
let page = q#param "page" in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: set_password.ml,v 1.5 2006/03/28 16:24:08 rich Exp $
+ * $Id: set_password.ml,v 1.6 2006/12/06 09:46:57 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
if password1 <> password2 then (
error ~back_button:true ~title:"Passwords don't match"
- dbh hostid q "The two passwords you gave aren't identical.";
+ r dbh hostid q "The two passwords you gave aren't identical.";
return ()
);
PGOCaml.commit dbh;
ok ~title:"Password updated" ~buttons:[ok_button "/_users"]
- dbh hostid q "The password on that user account was updated."
+ r dbh hostid q "The password on that user account was updated."
let () =
register_script ~restrict:[CanManageUsers] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: set_password_form.ml,v 1.3 2006/03/28 16:24:08 rich Exp $
+ * $Id: set_password_form.ml,v 1.4 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "set_password_form.html" in
+ let template = get_template r dbh hostid "set_password_form.html" in
let userid = Int32.of_string (q#param "userid") in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: signup.ml,v 1.11 2006/03/28 16:24:08 rich Exp $
+ * $Id: signup.ml,v 1.12 2006/12/06 09:46:57 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
if not create_account_anon then (
error ~title:"Not allowed to create accounts"
- dbh hostid q ("To get an account on this service, please contact the " ^
- "administrator.");
+ r dbh hostid q
+ ("To get an account on this service, please contact the " ^
+ "administrator.");
return ()
);
if username = "" || password1 = "" || password2 = "" then (
error ~back_button:true ~title:"Bad username or password"
- dbh hostid q "The username or password you gave is empty.";
+ r dbh hostid q "The username or password you gave is empty.";
return ()
);
if password1 <> password2 then (
error ~back_button:true ~title:"Passwords don't match"
- dbh hostid q "The two passwords you gave aren't identical.";
+ r dbh hostid q "The two passwords you gave aren't identical.";
return ()
);
if UTF8.length username > 32 || UTF8.length password > 128 then (
error ~back_button:true ~title:"Username or password too long"
- dbh hostid q "Usernames should be less than 32 characters long. For passwords we let you have a generous 128 characters.";
+ r dbh hostid q "Usernames should be less than 32 characters long. For passwords we let you have a generous 128 characters.";
return ()
);
(match rows with
| [_] ->
error ~back_button:true ~title:"Username already taken"
- dbh hostid q
+ r dbh hostid q
("Someone, possibly you, has already taken that username. " ^
"If you think you have forgotten your password, try going back " ^
"and clicking on the 'Forgotten your password?' link.");
ok ~title:"Account created"
~buttons
~cookie
- dbh hostid q
+ r dbh hostid q
("An account was created for you, " ^ username ^ ". " ^
"We hope you enjoy using this service.")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: sitemap.ml,v 1.10 2006/07/27 16:46:55 rich Exp $
+ * $Id: sitemap.ml,v 1.11 2006/12/06 09:46:57 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
open Cocanwiki_strings
let run r (q : cgi) dbh hostid { hostname = hostname } _ =
- let template = get_template dbh hostid "sitemap.html" in
+ let template = get_template r dbh hostid "sitemap.html" in
(* Pull out all the current pages, and a bit of content from each. *)
let rows = PGSQL(dbh)
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: sitemap_rss.ml,v 1.1 2006/09/22 10:50:38 rich Exp $
+ * $Id: sitemap_rss.ml,v 1.2 2006/12/06 09:46:57 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
open Cocanwiki_strings
let run r (q : cgi) dbh hostid {hostname = hostname} _ =
- let template = get_template dbh hostid "sitemap_rss.xml" in
+ let template = get_template r dbh hostid "sitemap_rss.xml" in
template#set "hostname" hostname;
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: sitemap_xml.ml,v 1.3 2006/03/28 16:24:08 rich Exp $
+ * $Id: sitemap_xml.ml,v 1.4 2006/12/06 09:46:57 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 run r (q : cgi) dbh hostid { hostname = hostname } _ =
- let template = get_template dbh hostid "sitemap.xml" in
+ let template = get_template r dbh hostid "sitemap.xml" in
(* Pull out all the current pages. *)
let rows = PGSQL(dbh)
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: source.ml,v 1.7 2006/08/17 09:11:31 rich Exp $
+ * $Id: source.ml,v 1.8 2006/12/06 09:46:57 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
with
Not_found ->
error ~title:"Page not found"
- dbh hostid q "That page was not found";
+ r dbh hostid q "That page was not found";
return () in
(* XXX CSS - eventually both title and CSS fields should be returned in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: stats.ml,v 1.6 2006/03/28 16:24:08 rich Exp $
+ * $Id: stats.ml,v 1.7 2006/12/06 09:46:57 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
open Cocanwiki_server_settings
let run r (q : cgi) dbh hostid { canonical_hostname = canonical_hostname } _ =
- let template = get_template dbh hostid "stats.html" in
+ let template = get_template r dbh hostid "stats.html" in
let page = q#param "page" in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: stats_top.ml,v 1.3 2006/03/27 18:09:47 rich Exp $
+ * $Id: stats_top.ml,v 1.4 2006/12/06 09:46:57 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 run r (q : cgi) dbh hostid
{ canonical_hostname = canonical_hostname } _ =
- let template = get_template dbh hostid "stats_top.html" in
+ let template = get_template r dbh hostid "stats_top.html" in
let page = q#param "page" in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: tarpit_form.ml,v 1.1 2006/08/09 15:35:47 rich Exp $
+ * $Id: tarpit_form.ml,v 1.2 2006/12/06 09:46:57 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
* /_bin/tarpit.cmo which will print their IP address for banning.
*)
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "tarpit_form.html" in
+ let template = get_template r dbh hostid "tarpit_form.html" in
let rand = Random.int 999_999_999 in
template#set "rand" (string_of_int rand);
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: undelete_file.ml,v 1.9 2006/03/28 16:24:08 rich Exp $
+ * $Id: undelete_file.ml,v 1.10 2006/12/06 09:46:57 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
(* Done. *)
let buttons = [ ok_button "/_files" ] in
ok ~title:"File restored" ~buttons
- dbh hostid q "File was restored successfully."
+ r dbh hostid q "File was restored successfully."
) else
q#redirect ("http://" ^ hostname ^ "/_files")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: undelete_file_form.ml,v 1.9 2006/03/28 16:24:08 rich Exp $
+ * $Id: undelete_file_form.ml,v 1.10 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "undelete_file_form.html" in
+ let template = get_template r dbh hostid "undelete_file_form.html" in
let id = Int32.of_string (q#param "id") in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: undelete_image.ml,v 1.9 2006/03/28 16:24:08 rich Exp $
+ * $Id: undelete_image.ml,v 1.10 2006/12/06 09:46:57 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
(* Done. *)
let buttons = [ ok_button "/_images" ] in
ok ~title:"Image restored" ~buttons
- dbh hostid q "Image was restored successfully."
+ r dbh hostid q "Image was restored successfully."
) else
q#redirect ("http://" ^ hostname ^ "/_images")
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: undelete_image_form.ml,v 1.9 2006/03/28 16:24:08 rich Exp $
+ * $Id: undelete_image_form.ml,v 1.10 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "undelete_image_form.html" in
+ let template = get_template r dbh hostid "undelete_image_form.html" in
let id = Int32.of_string (q#param "id") in
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: upload_file.ml,v 1.13 2006/03/28 16:24:08 rich Exp $
+ * $Id: upload_file.ml,v 1.14 2006/12/06 09:46:57 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
with
Not_found ->
error ~title:"No file" ~back_button:true
- dbh hostid q "No file was uploaded.";
+ r dbh hostid q "No file was uploaded.";
return () in
(* Check the name is valid. *)
if not (Pcre.pmatch ~rex:file_ok_re name) then (
error ~title:"Bad File Name" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("The File Name must contain only lowercase English letters, " ^
"numbers, dots, dashes and underscore.");
return ()
if exists then (
if not replace then (
error ~title:"File already exists" ~back_button:true
- dbh hostid q "An file with the same name already exists.";
+ r dbh hostid q "An file with the same name already exists.";
return ()
) else (
PGSQL(dbh) "update files
let buttons = [ ok_button "/_files" ] in
ok ~title:"File uploaded" ~buttons
- dbh hostid q "File was uploaded successfully."
+ r dbh hostid q "File was uploaded successfully."
let () =
register_script ~restrict:[CanEdit] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: upload_file_form.ml,v 1.10 2006/03/28 16:24:08 rich Exp $
+ * $Id: upload_file_form.ml,v 1.11 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "upload_file_form.html" in
+ let template = get_template r dbh hostid "upload_file_form.html" in
(* If called with a 'name' argument, prefill the name field.
* If called with an 'id' argument, get the name field from the
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: upload_image.ml,v 1.14 2006/03/28 16:24:08 rich Exp $
+ * $Id: upload_image.ml,v 1.15 2006/12/06 09:46:57 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
with
Not_found ->
error ~title:"No image" ~back_button:true
- dbh hostid q "No image was uploaded.";
+ r dbh hostid q "No image was uploaded.";
return () in
(* Check the name is valid. *)
if not (Pcre.pmatch ~rex:image_ok_re name) then (
error ~title:"Bad Image Name" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("The Image Name must contain only lowercase English letters, " ^
"numbers, dots, dashes and underscore. " ^
"It must end with .jpg, .gif or .png " ^
with
Invalid_argument _ ->
error ~title:"Bad image" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("Unknown image type. Is the file you uploaded really an " ^
"image?");
return () in
| _ -> assert false in
if not ext_ok then (
error ~title:"Bad Image Name" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("The Image Name extension has to match the image format. " ^
"For example if the image is in JPEG format, the name must " ^
"be 'something.jpg'. I detected the following image type " ^
(* Check some ALT text was supplied. *)
if string_is_whitespace alt then (
error ~title:"Missing Alt text" ~back_button:true
- dbh hostid q
+ r dbh hostid q
("You must supply Alt text describing the image. This is required " ^
"by accessibility laws and to allow search engines to discover the " ^
"content of images.");
if exists then (
if not replace then (
error ~title:"Image already exists" ~back_button:true
- dbh hostid q "An image with the same name already exists.";
+ r dbh hostid q "An image with the same name already exists.";
return ()
) else (
PGSQL(dbh) "update images
let buttons = [ ok_button "/_images" ] in
ok ~title:"Image uploaded" ~buttons
- dbh hostid q "Image was uploaded successfully."
+ r dbh hostid q "Image was uploaded successfully."
let () =
register_script ~restrict:[CanEdit] run
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: upload_image_form.ml,v 1.10 2006/03/28 16:24:08 rich Exp $
+ * $Id: upload_image_form.ml,v 1.11 2006/12/06 09:46:57 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
open Cocanwiki_template
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "upload_image_form.html" in
+ let template = get_template r dbh hostid "upload_image_form.html" in
(* If called with a 'name' argument, prefill the name field.
* If called with an 'id' argument, get the name field from the
(* 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.9 2006/07/31 09:49:43 rich Exp $
+ * $Id: user_prefs.ml,v 1.10 2006/12/06 09:46:57 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 buttons = [ ok_button "/_userprefs" ] in
ok ~title:"Preferences updated" ~buttons
- dbh hostid q
+ r dbh hostid q
("Your user preferences were updated. " ^
if confirm_needed then
("Because you changed your email address, we have sent a " ^
(* 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.5 2006/03/28 16:24:08 rich Exp $
+ * $Id: user_prefs_form.ml,v 1.6 2006/12/06 09:46:57 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
open Cocanwiki_date
let run r (q : cgi) dbh hostid host user =
- let template = get_template dbh hostid "user_prefs_form.html" in
+ let template = get_template r dbh hostid "user_prefs_form.html" in
let userid, name, prefs =
match user with
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: users.ml,v 1.11 2006/07/26 16:34:18 rich Exp $
+ * $Id: users.ml,v 1.12 2006/12/06 09:46:57 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
open Cocanwiki_date
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "users.html" in
+ let template = get_template r dbh hostid "users.html" in
let rows =
PGSQL(dbh)
(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: what_links_here.ml,v 1.6 2006/03/28 16:24:08 rich Exp $
+ * $Id: what_links_here.ml,v 1.7 2006/12/06 09:46:57 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
open Cocanwiki_links
let run r (q : cgi) dbh hostid _ _ =
- let template = get_template dbh hostid "what_links_here.html" in
+ let template = get_template r dbh hostid "what_links_here.html" in
let page = q#param "page" in
template#set "page" page;
<h1><span>Edit global stylesheet</span></h1>
<form method="post" action="edit_host_css.cmo">
+<input type="hidden" name="css" value="::css_html_tag::" />
<p>
Editing the global stylesheet:
</p>
<p>
-<textarea name="css" cols="80" rows="30">::css_html_textarea::</textarea>
+<textarea name="content" cols="80" rows="30">::content_html_textarea::</textarea>
</p>
<p>
<meta name="author" content="http://merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
-::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_ie6_fixes_css)::
+<!--[if ie 6]><link rel="stylesheet" href="/_ie6_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::::if(has_ie7_fixes_css)::
+<!--[if ie 7]><link rel="stylesheet" href="/_ie7_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::
<link rel="stylesheet" href="/_css/login.css" type="text/css" title="Standard"/>
</head><body>
</tr>
<tr>
<th> Global stylesheet: </th>
-<td> ::if(has_global_css)::<a href="/_global.css">View global stylesheet</a>::else::No global stylesheet for this site.::end::<br/>
+<td>
+::if(has_global_css)::<a href="/_global.css">View global stylesheet</a>::else::No global stylesheet for this site.::end:: <br/>
+::if(has_ie6_fixes_css)::<a href="/_ie6_fixes.css">View IE6 fixes stylesheet</a>::else::No IE6 fixes stylesheet for this site.::end:: <br/>
+::if(has_ie7_fixes_css)::<a href="/_ie7_fixes.css">View IE7 fixes stylesheet</a>::else::No IE7 fixes stylesheet for this site.::end:: <br/>
::if(can_edit_global_css)::
-<a href="/_bin/edit_host_css_form.cmo">Edit global stylesheet ...</a>
+<a href="/_bin/edit_host_css_form.cmo">Edit global stylesheet ...</a> <br/>
+<a href="/_bin/edit_host_css_form.cmo?css=ie6_fixes">Edit IE6 fixes stylesheet ...</a> <br/>
+<a href="/_bin/edit_host_css_form.cmo?css=ie7_fixes">Edit IE7 fixes stylesheet ...</a>
::end::
</td>
</tr>
<meta name="author" content="http://merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
-::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_ie6_fixes_css)::
+<!--[if ie 6]><link rel="stylesheet" href="/_ie6_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::::if(has_ie7_fixes_css)::
+<!--[if ie 7]><link rel="stylesheet" href="/_ie7_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::
<link rel="stylesheet" href="/_css/login.css" type="text/css" title="Standard"/>
</head><body>
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="stylesheet" href="/_css/search.css" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
-::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_ie6_fixes_css)::
+<!--[if ie 6]><link rel="stylesheet" href="/_ie6_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::::if(has_ie7_fixes_css)::
+<!--[if ie 7]><link rel="stylesheet" href="/_ie7_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::
</head><body onload="document.f.q.focus ()">
<h1><span>Page not found</span></h1>
<meta name="author" content="http://merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
-::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_ie6_fixes_css)::
+<!--[if ie 6]><link rel="stylesheet" href="/_ie6_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::::if(has_ie7_fixes_css)::
+<!--[if ie 7]><link rel="stylesheet" href="/_ie7_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::
</head><body>
<h1><span>Send an email when the page is updated</span></h1>
<meta name="author" content="http://merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>::if(has_host_css)::
-<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_page_css)::
+<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_ie6_fixes_css)::
+<!--[if ie 6]><link rel="stylesheet" href="/_ie6_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::::if(has_ie7_fixes_css)::
+<!--[if ie 7]><link rel="stylesheet" href="/_ie7_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::::if(has_page_css)::
<link rel="stylesheet" href="/::page_html_tag::/styles.css::if(is_old_version)::?version=::old_version::::end::" type="text/css" title="Standard"/>::end::::if(ie_imagetoolbar_no)::
<meta http-equiv="imagetoolbar" content="no" />::end::
<script src="/_js/go.js" type="text/javascript"></script>
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="stylesheet" href="/_css/search.css" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
-::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_ie6_fixes_css)::
+<!--[if ie 6]><link rel="stylesheet" href="/_ie6_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::::if(has_ie7_fixes_css)::
+<!--[if ie 7]><link rel="stylesheet" href="/_ie7_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::
</head><body onload="document.f.q.focus ()">
<h1><span>Search this site</span></h1>
<meta name="author" content="http://merjis.com/" />
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
-::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_ie6_fixes_css)::
+<!--[if ie 6]><link rel="stylesheet" href="/_ie6_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::::if(has_ie7_fixes_css)::
+<!--[if ie 7]><link rel="stylesheet" href="/_ie7_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::
</head><body>
<h1><span>Send feedback about this page</span></h1>
<link rel="stylesheet" href="::theme_css_html_tag::" type="text/css" title="Standard"/>
<link rel="stylesheet" href="/_css/sitemap.css" type="text/css" title="Standard"/>
<link rel="alternate stylesheet" href="/_css/easytoread.css" type="text/css" title="High contrast, big fonts"/>
-::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::
+::if(has_host_css)::<link rel="stylesheet" href="/_global.css" type="text/css" title="Standard"/>::end::::if(has_ie6_fixes_css)::
+<!--[if ie 6]><link rel="stylesheet" href="/_ie6_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::::if(has_ie7_fixes_css)::
+<!--[if ie 7]><link rel="stylesheet" href="/_ie7_fixes.css" type="text/css" title="Standard"/><![endif]-->::end::
</head><body>
<h1><span>Sitemap</span></h1>