(* 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.9 2005/03/31 14:24:04 rich Exp $
+ * $Id: create_host.ml,v 1.10 2005/11/24 14:54:14 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"
- q "You must give a title for this Wiki.";
+ dbh (-1) 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
- q "A new Wiki was created."
+ dbh (-1) 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.6 2005/03/31 14:24:04 rich Exp $
+ * $Id: edit_host_css.ml,v 1.7 2005/11/24 14:54:14 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
- q ("The stylesheet was changed successfully. " ^
- "Note: You must RELOAD the page to see changes to stylesheets.")
+ dbh (-1) q
+ ("The stylesheet was changed successfully. " ^
+ "Note: You must RELOAD the page to see changes to stylesheets.")
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: edit_hostnames.ml,v 1.7 2005/03/31 14:24:04 rich Exp $
+ * $Id: edit_hostnames.ml,v 1.8 2005/11/24 14:54:14 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
- q "Hostnames updated."
+ dbh (-1) 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: change_password.ml,v 1.3 2004/10/30 10:16:09 rich Exp $
+ * $Id: change_password.ml,v 1.4 2005/11/24 14:54:11 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
- q "The password you gave is wrong.";
+ dbh hostid q "The password you gave is wrong.";
return ()
);
if password1 = "" || password2 = "" then (
error ~back_button:true ~title:"Bad password"
- q "The password you gave is empty.";
+ dbh hostid q "The password you gave is empty.";
return ()
);
if password1 <> password2 then (
error ~back_button:true ~title:"Passwords don't match"
- q "The two passwords you gave aren't identical.";
+ dbh hostid q "The two passwords you gave aren't identical.";
return ()
);
let buttons = [ ok_button "/" ] in
ok ~buttons ~title:"Password changed"
- q "The password was changed."
+ 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: contact.ml,v 1.8 2005/03/31 14:24:04 rich Exp $
+ * $Id: contact.ml,v 1.9 2005/11/24 14:54:11 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 fail msg =
error ~back_button:true ~title:"Bad form"
- q (msg ^ " Please contact the owner of the site by email.");
+ 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 "/"]
- q "An email was sent and you should receive a reply shortly."
+ 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: create_contact.ml,v 1.4 2005/11/17 10:14:42 rich Exp $
+ * $Id: create_contact.ml,v 1.5 2005/11/24 14:54:11 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"
- q "You must name your contact form.";
+ dbh hostid q "You must name your contact form.";
return ()
);
if subject = "" then (
error ~back_button:true ~title:"Subject line missing"
- q "You must give a subject line, which appears on contact emails.";
+ 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"
- q ("There are no email addresses listed for this contact form. You " ^
- "must list at least one valid email address.");
+ 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", string_of_int contactid ] } ] in
- ok ~title:"Contact form created" ~buttons q msg
+ ok ~title:"Contact form created" ~buttons 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_user.ml,v 1.5 2004/10/23 09:36:11 rich Exp $
+ * $Id: create_user.ml,v 1.6 2005/11/24 14:54:11 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"
- q "The username or password you gave is empty.";
+ 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"
- q "The two passwords you gave aren't identical.";
+ dbh hostid q "The two passwords you gave aren't identical.";
return ()
);
(try
sth#fetch1 ();
error ~back_button:true ~title:"Username already taken"
- q "Someone has already taken that username.";
+ dbh hostid q "Someone has already taken that username.";
return ()
with
Not_found -> ());
let buttons = [ ok_button "/_users" ] in
ok ~title:"Account created" ~buttons
- q ("An account was created for " ^ username ^ ".")
+ 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: delete_contact.ml,v 1.3 2005/11/23 11:32:13 rich Exp $
+ * $Id: delete_contact.ml,v 1.4 2005/11/24 14:54:11 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
dbh#commit ();
ok ~title:"Contact form(s) deleted" ~buttons:[ok_button "/_bin/contacts.cmo"]
- q "Those contact form(s) were deleted."
+ 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_file.ml,v 1.8 2004/11/01 17:05:14 rich Exp $
+ * $Id: delete_file.ml,v 1.9 2005/11/24 14:54:11 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
- q "File was deleted successfully."
+ 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_image.ml,v 1.8 2004/11/01 17:05:14 rich Exp $
+ * $Id: delete_image.ml,v 1.9 2005/11/24 14:54:11 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
- q "Image was deleted successfully."
+ 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_user.ml,v 1.4 2004/10/30 10:16:10 rich Exp $
+ * $Id: delete_user.ml,v 1.5 2005/11/24 14:54:11 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"
- q "You cannot delete your own user account.";
+ dbh hostid q "You cannot delete your own user account.";
return ()
| _ -> () in
dbh#commit ();
ok ~title:"Account deleted" ~buttons:[ok_button "/_users"]
- q "That user account was deleted."
+ 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.3 2004/10/30 10:16:10 rich Exp $
+ * $Id: delete_user_form.ml,v 1.4 2005/11/24 14:54:11 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"
- q "You cannot delete your own user account.";
+ 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: edit.ml,v 1.26 2005/03/31 14:24:04 rich Exp $
+ * $Id: edit.ml,v 1.27 2005/11/24 14:54:11 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return ()
| Wikilib.GenURL_TooShort | Wikilib.GenURL_BadURL ->
error ~back_button:true ~title:"Bad page name"
- q "The page name supplied is too short or invalid.";
+ dbh hostid q
+ "The page name supplied is too short or invalid.";
return () in
let model = match pt with
with
SaveURLError ->
error ~back_button:true ~title:"Page exists"
- q ("While you were editing that page, it looks " ^
- "like another user created the same page.");
+ 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) ->
return ()
in
- (* This codes decides where we are in the current editing cycle.
+ (* This code decides where we are in the current editing cycle.
*
* Inputs:
* id - if set, then we are in the midst of editing a page.
(* 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.3 2005/03/31 14:24:04 rich Exp $
+ * $Id: edit_contact.ml,v 1.4 2005/11/24 14:54:11 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"
- q "You must name your contact form.";
+ dbh hostid q "You must name your contact form.";
return ()
);
if subject = "" then (
error ~back_button:true ~title:"Subject line missing"
- q "You must give a subject line, which appears on contact emails.";
+ 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"
- q ("There are no email addresses listed for this contact form. You " ^
- "must list at least one valid email address.");
+ 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", string_of_int id ] } ] in
ok ~title:"Contact form edited" ~buttons
- q "The contact form was edited."
+ 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_file.ml,v 1.2 2005/07/19 08:58:39 rich Exp $
+ * $Id: edit_file.ml,v 1.3 2005/11/24 14:54:11 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
- q "The description fields were updated."
+ 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_host_css.ml,v 1.4 2005/03/31 14:24:04 rich Exp $
+ * $Id: edit_host_css.ml,v 1.5 2005/11/24 14:54:11 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:"Global stylesheet changed" ~buttons
- q ("The stylesheet was changed successfully. " ^
- "Note: You must RELOAD the page to see changes to stylesheets.")
+ dbh hostid q
+ ("The stylesheet was changed successfully. " ^
+ "Note: You must RELOAD the page to see changes to stylesheets.")
let () =
register_script ~restrict:[CanEditGlobalCSS] 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.ml,v 1.8 2005/11/16 17:30:33 rich Exp $
+ * $Id: edit_host_settings.ml,v 1.9 2005/11/24 14:54:11 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"]
- q "The global settings were updated."
+ 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_image.ml,v 1.2 2005/07/19 08:58:39 rich Exp $
+ * $Id: edit_image.ml,v 1.3 2005/11/24 14:54:11 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
- 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.");
+ 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.");
return ()
);
let buttons = [ ok_button "/_images" ] in
ok ~title:"Description fields updated" ~buttons
- q "The description fields were updated."
+ 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_page_css.ml,v 1.17 2005/11/17 10:14:42 rich Exp $
+ * $Id: edit_page_css.ml,v 1.18 2005/11/24 14:54:11 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
- q ("The stylesheet was changed successfully. " ^
- "Note: You must RELOAD the page to see changes to stylesheets.")
+ dbh hostid q
+ ("The stylesheet was changed successfully. " ^
+ "Note: You must RELOAD the page to see changes to stylesheets.")
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_sitemenu.ml,v 1.8 2004/12/01 13:55:55 rich Exp $
+ * $Id: edit_sitemenu.ml,v 1.9 2005/11/24 14:54:11 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/host_menu.cmo" ] in
ok ~title:"Saved" ~buttons
- q "The site menu was saved."
+ 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.9 2004/10/30 10:16:10 rich Exp $
+ * $Id: edit_user.ml,v 1.10 2005/11/24 14:54:12 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"
- q "The username you gave is empty.";
+ dbh hostid q "The username you gave is empty.";
return ()
);
(try
sth#fetch1 ();
error ~back_button:true ~title:"Username already taken"
- q ("That username has already been taken by another user.");
+ dbh hostid q
+ ("That username has already been taken by another user.");
return ()
with
Not_found -> ());
(match can_manage_users, self with
| false, User (id, _, _, _) when id = userid ->
error ~back_button:true ~title:"Remove manage users from self"
- 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.");
+ 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.");
return ()
| _ -> ());
let buttons = [ ok_button "/_users" ] in
ok ~buttons ~title:"Saved"
- q "Changes were saved."
+ 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: email_change.ml,v 1.1 2004/10/23 15:00:14 rich Exp $
+ * $Id: email_change.ml,v 1.2 2005/11/24 14:54:12 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:"Already verified"
- q ("It looks like you have already verified this email address.");
+ dbh hostid q
+ ("It looks like you have already verified this email address.");
return () in
(* Update the database. *)
dbh#commit ();
ok ~title:"Email address verified"
- q "Thank you for verifying your new email address."
+ 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: forgot_password.ml,v 1.7 2005/03/31 14:24:04 rich Exp $
+ * $Id: forgot_password.ml,v 1.8 2005/11/24 14:54:12 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"
- q "You didn't give a username or email address";
+ dbh hostid q "You didn't give a username or email address";
return ()
);
let buttons = [ ok_button "/_login" ] in
ok ~buttons ~title:"Password sent by email"
- q
+ 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.")
with
Unix.sleep 10;
error ~back_button:true ~title:"Nothing known"
- q "Sorry, don't know anyone with that name or email address."
+ dbh hostid q
+ "Sorry, don't know anyone with that name or 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: invite_user.ml,v 1.4 2005/03/31 14:24:04 rich Exp $
+ * $Id: invite_user.ml,v 1.5 2005/11/24 14:54:12 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"
- q "We sent invitations emails to those address(es)."
+ 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.3 2005/03/31 14:24:04 rich Exp $
+ * $Id: invite_user_confirm.ml,v 1.4 2005/11/24 14:54:12 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
| _ -> assert false
with Not_found ->
error ~title:"Already signed up"
- q "It looks like you have already used your invitation.";
+ dbh hostid q "It looks like you have already used your invitation.";
return () in
let password1 = q#param "password1" in
if password1 = "" || password2 = "" then (
error ~back_button:true ~title:"Bad password"
- q "The password you gave is empty.";
+ dbh hostid q "The password you gave is empty.";
return ()
);
if password1 <> password2 then (
error ~back_button:true ~title:"Passwords don't match"
- q "The two passwords you gave aren't identical.";
+ 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.2 2004/10/23 15:00:15 rich Exp $
+ * $Id: invite_user_confirm_form.ml,v 1.3 2005/11/24 14:54:12 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:"Already signed up"
- q ("It looks like you have already used your invitation. If " ^
- "you cannot get to your account, please contact the " ^
- "administrator.");
+ dbh hostid q
+ ("It looks like you have already used your invitation. If " ^
+ "you cannot get to your account, please contact the " ^
+ "administrator.");
return () in
(* Update the template so that the user can set their preferred password. *)
(* 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.7 2005/11/21 15:28:36 rich Exp $
+ * $Id: cocanwiki.ml,v 1.8 2005/11/24 14:54:15 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 hostname = try Request.hostname r
with Not_found ->
error ~back_button:true
- ~title:"Browser problem" q
+ ~title:"Browser problem" dbh (-1) 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\" header.");
with
Not_found ->
error ~back_button:true
- ~title:"Unknown website" q
+ ~title:"Unknown website" dbh (-1) 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"
- q "You do not have permission to access this part of the site."
+ 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.2 2005/03/31 14:24:05 rich Exp $
+ * $Id: cocanwiki_ok.ml,v 1.3 2005/11/24 14:54:15 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
(* Override Template.StdPages.ok and Template.StdPages.error with our versions.
* Also have some standard buttons around.
*)
-let ok_error_template = _get_template "ok_error.html"
-
let error ?cookie ?cookies ?title ?(icon = "/_graphics/error.png")
- ?icon_alt ?back_button ?close_button q message =
+ ?icon_alt ?back_button ?close_button dbh hostid q message =
+ let template = get_template 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:ok_error_template
+ 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 q message =
- Template.StdPages.ok ?cookie ?cookies ~template:ok_error_template
+ ?icon_alt ?back_button ?close_button ?buttons dbh hostid q message =
+ let template = get_template dbh hostid "ok_error.html" in
+ Template.StdPages.ok ?cookie ?cookies ~template
?title ~icon ?icon_alt ?back_button ?close_button ?buttons q message
let ok_button url = { Template.StdPages.label = " OK ";
(* 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.4 2005/11/16 17:30:34 rich Exp $
+ * $Id: cocanwiki_template.ml,v 1.5 2005/11/24 14:54:15 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 get_template ?page (dbh : Dbi.connection) hostid filename =
let template = _get_template filename in
- (* Get standard fields concerning this host from the database. *)
- let sth =
- dbh#prepare_cached
- "select h.theme_css, p.name, p.url, h.search_box,
- h.brand, h.brand_tagline, h.brand_description,
- h.pagebug
- from hosts h left outer join powered_by p on h.powered_by = p.id
- where h.id = ?" in
- sth#execute [`Int hostid];
-
- let theme_css, powered_by_name, powered_by_url, search_box,
+ if hostid > 0 then (
+ (* Get standard fields concerning this host from the database. *)
+ let sth =
+ dbh#prepare_cached
+ "select h.theme_css, p.name, p.url, h.search_box,
+ h.brand, h.brand_tagline, h.brand_description,
+ h.pagebug
+ from hosts h left outer join powered_by p on h.powered_by = p.id
+ where h.id = ?" in
+ sth#execute [`Int hostid];
+
+ let theme_css, powered_by_name, powered_by_url, search_box,
brand, brand_tagline, brand_description, pagebug =
- match sth#fetch1 () with
+ match sth#fetch1 () with
| [ a; b; c; d; e; f; g; h] -> a, b, c, d, e, f, g, h
| _ -> assert false in
- let theme_css =
- match theme_css with
+ let theme_css =
+ match theme_css with
| `Null -> "/_css/standard.css"
| `String file -> file
| _ -> assert false in
- let powered_by_name, powered_by_url =
- match powered_by_name, powered_by_url with
+ let powered_by_name, powered_by_url =
+ match powered_by_name, powered_by_url with
| `Null, `Null ->
let url = "http://sandbox.merjis.com/" in
let name = Cocanwiki_version.package ^ " " ^
| `String name, `String url -> name, url
| _ -> assert false in
- let search_box = match search_box with `Bool b -> b | _ -> assert false in
+ let search_box = match search_box with `Bool b -> b | _ -> assert false in
- let branding, brand,
+ let branding, brand,
has_brand_tagline, brand_tagline,
has_brand_description, brand_description =
- match brand with
+ match brand with
| `Null -> false, "", false, "", false, ""
| `String brand ->
let has_brand_tagline, brand_tagline =
match brand_tagline with
- | `Null -> false, ""
- | `String s -> true, s
- | _ -> assert false in
+ | `Null -> false, ""
+ | `String s -> true, s
+ | _ -> assert false in
let has_brand_description, brand_description =
match brand_description with
- | `Null -> false, ""
- | `String s -> true, s
- | _ -> assert false in
+ | `Null -> false, ""
+ | `String s -> true, s
+ | _ -> assert false in
true, brand,
- has_brand_tagline, brand_tagline,
- has_brand_description, brand_description
+ has_brand_tagline, brand_tagline,
+ has_brand_description, brand_description
| _ -> assert false in
- let has_pagebug, pagebug =
- match pagebug with
- | `Null -> false, ""
- | `String pagebug -> true, pagebug
- | _ -> assert false in
-
- template#set "theme_css" theme_css;
- template#set "powered_by_name" powered_by_name;
- template#set "powered_by_url" powered_by_url;
- template#conditional "search_box" search_box;
- template#conditional "branding" branding;
- template#set "brand" brand;
- template#conditional "has_brand_tagline" has_brand_tagline;
- template#set "brand_tagline" brand_tagline;
- template#conditional "has_brand_description" has_brand_description;
- template#set "brand_description" brand_description;
- template#conditional "has_pagebug" has_pagebug;
- template#set "pagebug" pagebug;
-
- (* Site menu. *)
- let sth = dbh#prepare_cached "select url, label, ordering from sitemenu
- where hostid = ? order by ordering" in
- sth#execute [`Int hostid];
-
- let is_homepage =
- match page with
+ let has_pagebug, pagebug =
+ match pagebug with
+ | `Null -> false, ""
+ | `String pagebug -> true, pagebug
+ | _ -> assert false in
+
+ template#set "theme_css" theme_css;
+ template#set "powered_by_name" powered_by_name;
+ template#set "powered_by_url" powered_by_url;
+ template#conditional "search_box" search_box;
+ template#conditional "branding" branding;
+ template#set "brand" brand;
+ template#conditional "has_brand_tagline" has_brand_tagline;
+ template#set "brand_tagline" brand_tagline;
+ template#conditional "has_brand_description" has_brand_description;
+ template#set "brand_description" brand_description;
+ template#conditional "has_pagebug" has_pagebug;
+ template#set "pagebug" pagebug;
+
+ (* Site menu. *)
+ let sth = dbh#prepare_cached "select url, label, ordering from sitemenu
+ where hostid = ? order by ordering" in
+ sth#execute [`Int hostid];
+
+ let is_homepage =
+ match page with
| None -> false
| Some "index" -> true
| _ -> false in
- template#conditional "is_homepage" is_homepage;
+ template#conditional "is_homepage" is_homepage;
- let table = sth#map (function [`String url; `String label; _] ->
- let is_linked =
- match page with
+ let table = sth#map (function [`String url; `String label; _] ->
+ let is_linked =
+ match page with
| None -> true
| Some page when page = url -> false
| _ -> true in
- let id = id_of_url url in
- [ "url", Template.VarString url;
- "label", Template.VarString label;
- "is_linked", Template.VarConditional is_linked;
- "id", Template.VarString id ]
+ let id = id_of_url url in
+ [ "url", Template.VarString url;
+ "label", Template.VarString label;
+ "is_linked", Template.VarConditional is_linked;
+ "id", Template.VarString id ]
| _ -> assert false) in
- template#table "sitemenu" table;
-
+ template#table "sitemenu" table;
+ )
+ else (* if we have no hostid *) (
+ template#set "theme_css" "/_css/standard.css";
+ template#set "powered_by_name" (Cocanwiki_version.package ^ " " ^
+ Cocanwiki_version.version);
+ template#set "powered_by_url" "http://sandbox.merjis.com/";
+ template#conditional "search_box" false;
+ template#conditional "branding" false;
+ template#set "brand" "";
+ template#conditional "has_brand_tagline" false;
+ template#set "brand_tagline" "";
+ template#conditional "has_brand_description" false;
+ template#set "brand_description" "";
+ template#conditional "has_pagebug" false;
+ template#set "pagebug" "";
+ template#conditional "is_homepage" false;
+ template#table "sitemenu" [];
+ );
(* Copyright year. *)
template#set "year" (string_of_int year);
(* 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.7 2005/11/21 15:28:35 rich Exp $
+ * $Id: login.ml,v 1.8 2005/11/24 14:54:12 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
) else [ ok_button ] in
ok ~title:"Logged in" ~buttons ~cookie
- q ("Welcome " ^ username ^ "." ^
+ dbh hostid q
+ ("Welcome " ^ username ^ "." ^
if force_password_change then " Please change your password now."
else "")
with
error
~title:"Bad name or password"
~back_button:true
- q "The name or password was wrong."
+ dbh hostid q "The name or password was wrong."
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: logout.ml,v 1.5 2005/03/31 14:24:04 rich Exp $
+ * $Id: logout.ml,v 1.6 2005/11/24 14:54:12 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 expires = "Sun, 09-Sep-2001 02:46:40 GMT"
-let run r (q : cgi) (dbh : Dbi.connection) _ _ user =
+let run r (q : cgi) (dbh : Dbi.connection) hostid _ user =
(* The logout function removes all of the associated cookies from the
* database. This isn't required, but is nice semantics, and also helps
* to reduce the size of the usercookies table in the database.
let cookie = Cookie.cookie "auth" "none" ~path:"/" ~expires in
ok ~title:"Logged out" ~buttons:[ok_button "/"] ~cookie
- q "You have been logged out."
+ 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.8 2005/11/17 10:14:42 rich Exp $
+ * $Id: mail_import.ml,v 1.9 2005/11/24 14:54:12 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 ~back_button:true ~title:"No message"
- q "No message was uploaded.";
+ 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"
- q "Date or Message-ID header missing. Cannot handle this message. ";
+ dbh hostid q
+ "Date or Message-ID header missing. Cannot handle this message. ";
return ()
);
let id = sth#fetch1int () in
if not overwrite then (
ok ~title:"Message exists"
- q "Message already imported";
+ dbh hostid q "Message already imported";
return ()
);
Some id
(* Finish off. *)
ok ~title:"Imported"
- q ("Message " ^ inet_message_id ^ " was imported.")
+ 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_rebuild.ml,v 1.1 2004/10/21 11:42:04 rich Exp $
+ * $Id: mail_rebuild.ml,v 1.2 2005/11/24 14:54:12 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"
- q ("Thread index rebuilt.")
+ 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.3 2004/10/04 15:19:56 rich Exp $
+ * $Id: mailing_list_confirm.ml,v 1.4 2005/11/24 14:54:12 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 ~close_button:true ~title:"Email already confirmed"
- q "It looks like that email address has already been confirmed.";
+ dbh hostid q
+ "It looks like that email address has already been confirmed.";
return () in
(* Update the database. *)
(* Confirmed. *)
let buttons = [ ok_button "/" ] in
ok ~buttons ~title:"Confirmed"
- q ("Your email address has been confirmed. " ^
- "You are now on our mailing list.")
+ 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_send.ml,v 1.5 2005/03/31 14:24:04 rich Exp $
+ * $Id: mailing_list_send.ml,v 1.6 2005/11/24 14:54:12 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 email = "" then (
error ~title:"No email address" ~back_button:true
- q "You must give an email address.";
+ dbh hostid q "You must give an email address.";
return ()
);
if registered then (
error ~title:"Email address already used" ~back_button:true
- q
+ 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"
- 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.")
+ 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.")
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_unsubscribe.ml,v 1.1 2004/09/24 16:41:16 rich Exp $
+ * $Id: mailing_list_unsubscribe.ml,v 1.2 2005/11/24 14:54:12 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"
- q "Your email address has been unsubscribed."
+ 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.ml,v 1.41 2005/11/23 11:05:54 rich Exp $
+ * $Id: page.ml,v 1.42 2005/11/24 14:54:12 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 rec loop page' i =
if i > max_redirect then (
error ~title:"Too many redirections" ~back_button:true
- q ("Too many redirects between pages. This may happen because " ^
- "of a cycle of redirections.");
+ dbh hostid q
+ ("Too many redirects between pages. This may happen because " ^
+ "of a cycle of redirections.");
return ()
) else
match fetch_page page' version allow_redirect with
(* 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.2 2004/10/04 15:19:56 rich Exp $
+ * $Id: page_email_confirm.ml,v 1.3 2005/11/24 14:54:12 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 ~close_button:true ~title:"Email already confirmed"
- q "It looks like that email address has already been confirmed.";
+ dbh hostid q
+ "It looks like that email address has already been confirmed.";
return () in
(* Update the database. *)
(* Confirmed. *)
let buttons = [ ok_button ("/" ^ page) ] in
ok ~buttons ~title:"Confirmed"
- q ("Your email address has been confirmed. You will now receive " ^
- "an email whenever that page is updated.")
+ dbh hostid q
+ ("Your email address has been confirmed. You will now receive " ^
+ "an email whenever that page is updated.")
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: page_email_send.ml,v 1.3 2005/03/31 14:24:04 rich Exp $
+ * $Id: page_email_send.ml,v 1.4 2005/11/24 14:54:12 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 email = "" then (
error ~title:"No email address" ~back_button:true
- q "You must give an email address.";
+ dbh hostid q "You must give an email address.";
return ()
);
if registered then (
error ~title:"Email address already used" ~back_button:true
- q
+ 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"
- 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.")
+ 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.")
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: page_email_unsubscribe.ml,v 1.1 2004/09/24 15:53:57 rich Exp $
+ * $Id: page_email_unsubscribe.ml,v 1.2 2005/11/24 14:54:12 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"
- q "Your email address has been unsubscribed."
+ 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: rename_page.ml,v 1.2 2004/11/22 11:11:52 rich Exp $
+ * $Id: rename_page.ml,v 1.3 2005/11/24 14:54:12 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"
- q "The new title cannot be empty.";
+ 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
- q ("The new title for the page isn't valid. " ^
- "It may be too short or it may not contain " ^
- "enough alphabet letters.");
+ 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.");
return () in
if page = new_page then (
with
SaveURLError ->
error ~title:"Page exists"
- 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 " ^
- "which you should raise with the site administrator.");
+ 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 " ^
+ "which you should raise with the site administrator.");
return ()
);
let buttons = [ ok_button ("/" ^ new_page) ] in
ok ~title:"Page renamed" ~buttons
- q "That page was renamed."
+ 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: restore.ml,v 1.18 2005/11/19 10:36:42 rich Exp $
+ * $Id: restore.ml,v 1.19 2005/11/24 14:54:12 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
- q "The old page was restored successfully."
+ 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.10 2004/11/01 12:57:53 rich Exp $
+ * $Id: restore_form.ml,v 1.11 2005/11/24 14:54:12 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 version = old_version then (
error ~back_button:true ~title:"Restoring live version"
- q "You seem to be trying to restore the live version.";
+ 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: send_feedback.ml,v 1.5 2005/03/31 14:24:04 rich Exp $
+ * $Id: send_feedback.ml,v 1.6 2005/11/24 14:54:12 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
(* Confirm. *)
ok ~title:"Thank you for your feedback" ~buttons:[ok_button "/"]
- q "An email has been sent to the site administrators."
+ 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: set_password.ml,v 1.2 2004/09/23 11:56:47 rich Exp $
+ * $Id: set_password.ml,v 1.3 2005/11/24 14:54:12 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"
- q "The two passwords you gave aren't identical.";
+ dbh hostid q "The two passwords you gave aren't identical.";
return ()
);
dbh#commit ();
ok ~title:"Password updated" ~buttons:[ok_button "/_users"]
- q "The password on that user account was updated."
+ 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: signup.ml,v 1.8 2005/11/17 10:14:42 rich Exp $
+ * $Id: signup.ml,v 1.9 2005/11/24 14:54:13 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"
- q "The username or password you gave is empty.";
+ 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"
- q "The two passwords you gave aren't identical.";
+ dbh hostid q "The two passwords you gave aren't identical.";
return ()
);
(try
sth#fetch1 ();
error ~back_button:true ~title:"Username already taken"
- 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.");
+ 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.");
return ()
with
Not_found -> ());
ok ~title:"Account created"
~buttons
~cookie
- q ("An account was created for you, " ^ username ^ ". " ^
- "We hope you enjoy using this service.")
+ dbh hostid q
+ ("An account was created for you, " ^ username ^ ". " ^
+ "We hope you enjoy using this service.")
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: source.ml,v 1.2 2004/11/02 18:47:54 rich Exp $
+ * $Id: source.ml,v 1.3 2005/11/24 14:54:13 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"
- q "That page was not found";
+ 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: undelete_file.ml,v 1.6 2004/09/09 12:21:22 rich Exp $
+ * $Id: undelete_file.ml,v 1.7 2005/11/24 14:54:13 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
- q "File was restored successfully."
+ 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_image.ml,v 1.6 2004/09/09 12:21:22 rich Exp $
+ * $Id: undelete_image.ml,v 1.7 2005/11/24 14:54:13 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
- q "Image was restored successfully."
+ 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: upload_file.ml,v 1.10 2004/11/01 17:05:14 rich Exp $
+ * $Id: upload_file.ml,v 1.11 2005/11/24 14:54:13 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
- q "No file was uploaded.";
+ 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
- q ("The File Name must contain only lowercase English letters, " ^
- "numbers, dots, dashes and underscore.");
+ 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
- q ("An file with the same name already exists.");
+ dbh hostid q "An file with the same name already exists.";
return ()
) else (
let sth = dbh#prepare_cached "update files
let buttons = [ ok_button "/_files" ] in
ok ~title:"File uploaded" ~buttons
- q "File was uploaded successfully."
+ 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_image.ml,v 1.11 2004/11/01 17:05:14 rich Exp $
+ * $Id: upload_image.ml,v 1.12 2005/11/24 14:54:13 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
- q "No image was uploaded.";
+ 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
- q ("The Image Name must contain only lowercase English letters, " ^
- "numbers, dots, dashes and underscore. " ^
- "It must end with .jpg, .gif or .png " ^
- "depending on the image format.");
+ 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 " ^
+ "depending on the image format.");
return ()
);
with
Invalid_argument _ ->
error ~title:"Bad image" ~back_button:true
- q ("Unknown image type. Is the file you uploaded really an " ^
- "image?");
+ dbh hostid q
+ ("Unknown image type. Is the file you uploaded really an " ^
+ "image?");
return () in
(* Check the image filename extension matches the MIME type. *)
| _ -> assert false in
if not ext_ok then (
error ~title:"Bad Image Name" ~back_button:true
- 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 " ^
- "in the file you uploaded: " ^ mime_type);
+ 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 " ^
+ "in the file you uploaded: " ^ mime_type);
return ()
);
(* Check some ALT text was supplied. *)
if string_is_whitespace alt then (
error ~title:"Missing Alt text" ~back_button:true
- 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.");
+ 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.");
return ()
);
if exists then (
if not replace then (
error ~title:"Image already exists" ~back_button:true
- q ("An image with the same name already exists.");
+ dbh hostid q "An image with the same name already exists.";
return ()
) else (
let sth = dbh#prepare_cached "update images
let buttons = [ ok_button "/_images" ] in
ok ~title:"Image uploaded" ~buttons
- q "Image was uploaded successfully."
+ 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: user_prefs.ml,v 1.5 2005/03/31 14:24:04 rich Exp $
+ * $Id: user_prefs.ml,v 1.6 2005/11/24 14:54:13 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
- q ("Your user preferences were updated. " ^
+ dbh hostid q
+ ("Your user preferences were updated. " ^
if confirm_needed then
("Because you changed your email address, we have sent a " ^
"confirmation email to your new address. You will need to " ^
</div>
::end::
+::if(has_pagebug)::::pagebug::::end::
+
<div id="footer_div">
<hr/>
::end::
</tr></table>
+::if(has_pagebug)::::pagebug::::end::
+
</body>
</html>