From 3bbcd6cd55f445a3b8b54269237655570c89354b Mon Sep 17 00:00:00 2001 From: rich Date: Wed, 6 Dec 2006 09:46:54 +0000 Subject: [PATCH] Add IE6- and IE7-specific stylesheets, only served to broken browsers. --- conf/cocanwiki.conf | 4 +++- schema/cocanwiki.sql | 4 +++- scripts/admin/create_host.ml | 6 +++--- scripts/admin/edit_host_css.ml | 4 ++-- scripts/admin/edit_hostnames.ml | 4 ++-- scripts/broken_links.ml | 4 ++-- scripts/change_password.ml | 10 ++++----- scripts/change_password_form.ml | 4 ++-- scripts/contact.ml | 9 ++++---- scripts/contact_show.ml | 4 ++-- scripts/contacts.ml | 4 ++-- scripts/crash.ml | 4 ++-- scripts/create_contact.ml | 10 ++++----- scripts/create_contact_form.ml | 4 ++-- scripts/create_macro.ml | 8 ++++---- scripts/create_macro_form.ml | 4 ++-- scripts/create_user.ml | 13 ++++++------ scripts/create_user_form.ml | 4 ++-- scripts/dead_ends.ml | 4 ++-- scripts/delete_contact.ml | 4 ++-- scripts/delete_contact_form.ml | 4 ++-- scripts/delete_file.ml | 4 ++-- scripts/delete_file_form.ml | 4 ++-- scripts/delete_image.ml | 4 ++-- scripts/delete_image_form.ml | 4 ++-- scripts/delete_macro.ml | 4 ++-- scripts/delete_macro_form.ml | 4 ++-- scripts/delete_user.ml | 6 +++--- scripts/delete_user_form.ml | 6 +++--- scripts/diff.ml | 4 ++-- scripts/edit.ml | 15 +++++++------- scripts/edit_contact.ml | 10 ++++----- scripts/edit_contact_form.ml | 4 ++-- scripts/edit_file.ml | 4 ++-- scripts/edit_file_form.ml | 4 ++-- scripts/edit_host_css.ml | 39 ++++++++++++++++++++++++++++------- scripts/edit_host_css_form.ml | 39 +++++++++++++++++++++++++++-------- scripts/edit_host_settings.ml | 4 ++-- scripts/edit_host_settings_form.ml | 4 ++-- scripts/edit_image.ml | 6 +++--- scripts/edit_image_form.ml | 4 ++-- scripts/edit_macro.ml | 4 ++-- scripts/edit_macro_form.ml | 4 ++-- scripts/edit_macros.ml | 4 ++-- scripts/edit_page_css.ml | 4 ++-- scripts/edit_page_css_form.ml | 4 ++-- scripts/edit_sitemenu.ml | 6 +++--- scripts/edit_user.ml | 10 ++++----- scripts/edit_user_form.ml | 4 ++-- scripts/email_change.ml | 6 +++--- scripts/files.ml | 4 ++-- scripts/forgot_password.ml | 8 ++++---- scripts/forgot_password_form.ml | 4 ++-- scripts/history.ml | 4 ++-- scripts/history_rss.ml | 4 ++-- scripts/host_menu.ml | 20 +++++++++++++----- scripts/hoststyle.ml | 32 ++++++++++++++++++++++++----- scripts/images.ml | 4 ++-- scripts/invite_user.ml | 4 ++-- scripts/invite_user_confirm.ml | 9 ++++---- scripts/invite_user_confirm_form.ml | 6 +++--- scripts/invite_user_form.ml | 4 ++-- scripts/largest_pages.ml | 4 ++-- scripts/lib/cocanwiki.ml | 8 ++++---- scripts/lib/cocanwiki_ok.ml | 10 ++++----- scripts/lib/cocanwiki_template.ml | 41 ++++++++++++++++++++++++++++++++++--- scripts/lib/cocanwiki_template.mli | 6 ++++-- scripts/links.ml | 4 ++-- scripts/login.ml | 6 +++--- scripts/login_form.ml | 4 ++-- scripts/logout.ml | 4 ++-- scripts/mail_import.ml | 12 +++++------ scripts/mail_import_form.ml | 4 ++-- scripts/mail_rebuild.ml | 4 ++-- scripts/mailing_list_confirm.ml | 8 ++++---- scripts/mailing_list_form.ml | 4 ++-- scripts/mailing_list_send.ml | 10 ++++----- scripts/mailing_list_unsubscribe.ml | 4 ++-- scripts/mailing_list_view.ml | 6 +++--- scripts/new_page_form.ml | 4 ++-- scripts/orphans.ml | 4 ++-- scripts/page.ml | 12 +++++------ scripts/page_email_confirm.ml | 6 +++--- scripts/page_email_form.ml | 4 ++-- scripts/page_email_send.ml | 10 ++++----- scripts/page_email_unsubscribe.ml | 4 ++-- scripts/page_rss.ml | 4 ++-- scripts/recent.ml | 4 ++-- scripts/recent_rss.ml | 4 ++-- scripts/recently_visited.ml | 4 ++-- scripts/rename_page.ml | 10 ++++----- scripts/rename_page_form.ml | 4 ++-- scripts/restore.ml | 4 ++-- scripts/restore_form.ml | 6 +++--- scripts/search.ml | 4 ++-- scripts/send_feedback.ml | 6 +++--- scripts/send_feedback_form.ml | 4 ++-- scripts/set_password.ml | 6 +++--- scripts/set_password_form.ml | 4 ++-- scripts/signup.ml | 17 +++++++-------- scripts/sitemap.ml | 4 ++-- scripts/sitemap_rss.ml | 4 ++-- scripts/sitemap_xml.ml | 4 ++-- scripts/source.ml | 4 ++-- scripts/stats.ml | 4 ++-- scripts/stats_top.ml | 4 ++-- scripts/tarpit_form.ml | 4 ++-- scripts/undelete_file.ml | 4 ++-- scripts/undelete_file_form.ml | 4 ++-- scripts/undelete_image.ml | 4 ++-- scripts/undelete_image_form.ml | 4 ++-- scripts/upload_file.ml | 10 ++++----- scripts/upload_file_form.ml | 4 ++-- scripts/upload_image.ml | 16 +++++++-------- scripts/upload_image_form.ml | 4 ++-- scripts/user_prefs.ml | 4 ++-- scripts/user_prefs_form.ml | 4 ++-- scripts/users.ml | 4 ++-- scripts/what_links_here.ml | 4 ++-- templates/edit_host_css_form.html | 3 ++- templates/forgot_password_form.html | 4 +++- templates/host_menu.html | 9 ++++++-- templates/login_form.html | 4 +++- templates/page_404_header.html | 4 +++- templates/page_email_form.html | 4 +++- templates/page_header.html | 4 +++- templates/search.html | 4 +++- templates/send_feedback_form.html | 4 +++- templates/sitemap.html | 4 +++- 129 files changed, 493 insertions(+), 347 deletions(-) diff --git a/conf/cocanwiki.conf b/conf/cocanwiki.conf index 578e854..290a2db 100644 --- a/conf/cocanwiki.conf +++ b/conf/cocanwiki.conf @@ -1,5 +1,5 @@ # 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. @@ -58,6 +58,8 @@ RewriteRule ^/_contact$ /_bin/contact.cmo [PT,L,QSA] 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] diff --git a/schema/cocanwiki.sql b/schema/cocanwiki.sql index b1f8e3e..03c4f41 100644 --- a/schema/cocanwiki.sql +++ b/schema/cocanwiki.sql @@ -1162,7 +1162,9 @@ CREATE TABLE hosts ( 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 ); diff --git a/scripts/admin/create_host.ml b/scripts/admin/create_host.ml index 5c08e0a..36fcbf4 100644 --- a/scripts/admin/create_host.ml +++ b/scripts/admin/create_host.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -46,7 +46,7 @@ let run r = 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 @@ -83,7 +83,7 @@ let run r = ] 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 () = diff --git a/scripts/admin/edit_host_css.ml b/scripts/admin/edit_host_css.ml index afb9ce5..7e41534 100644 --- a/scripts/admin/edit_host_css.ml +++ b/scripts/admin/edit_host_css.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit_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 @@ -54,7 +54,7 @@ let run r (q : cgi) dbh _ _ _ = ] 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.") diff --git a/scripts/admin/edit_hostnames.ml b/scripts/admin/edit_hostnames.ml index 604649c..32c5936 100644 --- a/scripts/admin/edit_hostnames.ml +++ b/scripts/admin/edit_hostnames.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit_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 @@ -82,7 +82,7 @@ let run r (q : cgi) dbh _ host' _ = ] in ok ~title:"Saved" ~buttons - dbh (-1l) q "Hostnames updated." + r dbh (-1l) q "Hostnames updated." let () = register_script run diff --git a/scripts/broken_links.ml b/scripts/broken_links.ml index a736fbc..17edcfa 100644 --- a/scripts/broken_links.ml +++ b/scripts/broken_links.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -30,7 +30,7 @@ open Cocanwiki_template 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 diff --git a/scripts/change_password.ml b/scripts/change_password.ml index 06e44be..fe2b8ba 100644 --- a/scripts/change_password.ml +++ b/scripts/change_password.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -49,7 +49,7 @@ let run r (q : cgi) dbh hostid _ user = 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 () ); @@ -58,13 +58,13 @@ let run r (q : cgi) dbh hostid _ user = 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 () ); @@ -79,7 +79,7 @@ let run r (q : cgi) dbh hostid _ user = 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 diff --git a/scripts/change_password_form.ml b/scripts/change_password_form.ml index 85fd414..7eddf8c 100644 --- a/scripts/change_password_form.ml +++ b/scripts/change_password_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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 diff --git a/scripts/contact.ml b/scripts/contact.ml index 6666b15..ba468af 100644 --- a/scripts/contact.ml +++ b/scripts/contact.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -33,11 +33,12 @@ open Cocanwiki_ok 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 @@ -168,7 +169,7 @@ let run r (q : cgi) dbh hostid {hostname = hostname} user = (* 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 diff --git a/scripts/contact_show.ml b/scripts/contact_show.ml index 69e49aa..ba13bb8 100644 --- a/scripts/contact_show.ml +++ b/scripts/contact_show.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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); diff --git a/scripts/contacts.ml b/scripts/contacts.ml index 5a0762c..1b572a1 100644 --- a/scripts/contacts.ml +++ b/scripts/contacts.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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) diff --git a/scripts/crash.ml b/scripts/crash.ml index d5aa886..25a7dec 100644 --- a/scripts/crash.ml +++ b/scripts/crash.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -32,7 +32,7 @@ open Cocanwiki_server_settings 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. *) diff --git a/scripts/create_contact.ml b/scripts/create_contact.ml index 0ec61db..eb87cea 100644 --- a/scripts/create_contact.ml +++ b/scripts/create_contact.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -41,20 +41,20 @@ let run r (q : cgi) dbh hostid _ _ = 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 () @@ -82,7 +82,7 @@ let run r (q : cgi) dbh hostid _ _ = 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 diff --git a/scripts/create_contact_form.ml b/scripts/create_contact_form.ml index c7fdb7b..0d27585 100644 --- a/scripts/create_contact_form.ml +++ b/scripts/create_contact_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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 diff --git a/scripts/create_macro.ml b/scripts/create_macro.ml index 96fed62..b6f65c4 100644 --- a/scripts/create_macro.ml +++ b/scripts/create_macro.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -36,13 +36,13 @@ let run r (q : cgi) dbh hostid _ _ = 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 () ); @@ -56,7 +56,7 @@ let run r (q : cgi) dbh hostid _ _ = 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 () = diff --git a/scripts/create_macro_form.ml b/scripts/create_macro_form.ml index 9346c81..fc101f9 100644 --- a/scripts/create_macro_form.ml +++ b/scripts/create_macro_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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 diff --git a/scripts/create_user.ml b/scripts/create_user.ml index 8cad0de..a0ff510 100644 --- a/scripts/create_user.ml +++ b/scripts/create_user.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -35,13 +35,13 @@ let run r (q : cgi) dbh hostid _ _ = 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 () ); @@ -49,7 +49,8 @@ let run r (q : cgi) dbh hostid _ _ = 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 () ); @@ -60,7 +61,7 @@ let run r (q : cgi) dbh hostid _ _ = (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 @@ -94,7 +95,7 @@ let run r (q : cgi) dbh hostid _ _ = 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 diff --git a/scripts/create_user_form.ml b/scripts/create_user_form.ml index 8a43809..75d2174 100644 --- a/scripts/create_user_form.ml +++ b/scripts/create_user_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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 diff --git a/scripts/dead_ends.ml b/scripts/dead_ends.ml index c72f56c..08afefc 100644 --- a/scripts/dead_ends.ml +++ b/scripts/dead_ends.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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) diff --git a/scripts/delete_contact.ml b/scripts/delete_contact.ml index 12bada0..0e211a9 100644 --- a/scripts/delete_contact.ml +++ b/scripts/delete_contact.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -53,7 +53,7 @@ let run r (q : cgi) dbh hostid { hostname = hostname } _ = 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 diff --git a/scripts/delete_contact_form.ml b/scripts/delete_contact_form.ml index 91b7f3b..44db5f0 100644 --- a/scripts/delete_contact_form.ml +++ b/scripts/delete_contact_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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. diff --git a/scripts/delete_file.ml b/scripts/delete_file.ml index 4e37289..baae7f2 100644 --- a/scripts/delete_file.ml +++ b/scripts/delete_file.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -56,7 +56,7 @@ let run r (q : cgi) dbh hostid { hostname = hostname } user= (* 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") diff --git a/scripts/delete_file_form.ml b/scripts/delete_file_form.ml index bc1e00e..f9661dc 100644 --- a/scripts/delete_file_form.ml +++ b/scripts/delete_file_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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 diff --git a/scripts/delete_image.ml b/scripts/delete_image.ml index 04cc50a..526ed8c 100644 --- a/scripts/delete_image.ml +++ b/scripts/delete_image.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -60,7 +60,7 @@ let run r (q : cgi) dbh hostid { hostname = hostname } user= (* 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") diff --git a/scripts/delete_image_form.ml b/scripts/delete_image_form.ml index 955b46a..4d42ac2 100644 --- a/scripts/delete_image_form.ml +++ b/scripts/delete_image_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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 diff --git a/scripts/delete_macro.ml b/scripts/delete_macro.ml index fc4a6cd..d76fe58 100644 --- a/scripts/delete_macro.ml +++ b/scripts/delete_macro.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -46,7 +46,7 @@ let run r (q : cgi) dbh hostid { hostname = hostname } _ = 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 diff --git a/scripts/delete_macro_form.ml b/scripts/delete_macro_form.ml index 609a23d..995cfb7 100644 --- a/scripts/delete_macro_form.ml +++ b/scripts/delete_macro_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -28,7 +28,7 @@ open Cocanwiki 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. diff --git a/scripts/delete_user.ml b/scripts/delete_user.ml index ecdc44a..653e7ed 100644 --- a/scripts/delete_user.ml +++ b/scripts/delete_user.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -46,7 +46,7 @@ let run r (q : cgi) dbh hostid {hostname = hostname} self = 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 @@ -63,7 +63,7 @@ let run r (q : cgi) dbh hostid {hostname = hostname} self = 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 diff --git a/scripts/delete_user_form.ml b/scripts/delete_user_form.ml index 8437488..7749947 100644 --- a/scripts/delete_user_form.ml +++ b/scripts/delete_user_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -29,7 +29,7 @@ open Cocanwiki_template 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); @@ -39,7 +39,7 @@ let run r (q : cgi) dbh hostid _ self = 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 diff --git a/scripts/diff.ml b/scripts/diff.ml index fb576c5..fa93674 100644 --- a/scripts/diff.ml +++ b/scripts/diff.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * 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 @@ -29,7 +29,7 @@ open Cocanwiki_template 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 diff --git a/scripts/edit.ml b/scripts/edit.ml index 9cdcc93..a3d50a4 100644 --- a/scripts/edit.ml +++ b/scripts/edit.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit.ml,v 1.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 @@ -35,9 +35,9 @@ open Cocanwiki_strings 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