(* 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.17 2004/10/11 14:13:04 rich Exp $
+ * $Id: cocanwiki.ml,v 1.18 2004/10/14 18:04: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
(* The "host object". *)
type host_t = { hostname : string;
+ canonical_hostname : string;
edit_anon : bool;
view_anon : bool }
(* Get the host ID, by comparing the Host: header with the hostnames
* table in the database.
*)
- let hostid, hostname, edit_anon, view_anon =
+ let hostid, hostname, canonical_hostname, edit_anon, view_anon =
let hostname = try Request.hostname r
with Not_found -> failwith "No ``Host:'' header in request" in
let hostname = String.lowercase hostname in
try
(match sth#fetch1 () with
- [ `Int id; `String hostname;
+ [ `Int id; `String canonical_hostname;
`Bool edit_anon; `Bool view_anon ] ->
- id, hostname, edit_anon, view_anon
+ id, hostname, canonical_hostname, edit_anon, view_anon
| _ -> assert false)
with
Not_found ->
(* Create the host object. *)
let host = { hostname = hostname;
+ canonical_hostname = canonical_hostname;
edit_anon = edit_anon;
view_anon = view_anon } in