From aa707ecceaeb33816feb249f7f68423c1e5ee697 Mon Sep 17 00:00:00 2001 From: rich Date: Sat, 9 Oct 2004 12:24:47 +0000 Subject: [PATCH] Allow callers to create_host to specify an email address for the admin account. --- debian/changelog | 2 +- scripts/admin/create_host.ml | 4 ++-- scripts/cocanwiki_create_host.ml | 13 +++++++------ scripts/cocanwiki_create_host.mli | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index d875823..4cc38fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -cocanwiki (1.2.1-2) unstable; urgency=low +cocanwiki (1.2.1-3) unstable; urgency=low * Initial Release. diff --git a/scripts/admin/create_host.ml b/scripts/admin/create_host.ml index 9e1b627..3fb8f44 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.7 2004/10/06 10:34:30 rich Exp $ + * $Id: create_host.ml,v 1.8 2004/10/09 12:24:48 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 @@ -68,7 +68,7 @@ let run r = else 0 in let hostid = create_host dbh canonical_hostname hostnames template title - "Administrator" "123456" true in + "Administrator" "123456" true None in (* Commit to the database. *) dbh#commit (); diff --git a/scripts/cocanwiki_create_host.ml b/scripts/cocanwiki_create_host.ml index b528efd..981f978 100644 --- a/scripts/cocanwiki_create_host.ml +++ b/scripts/cocanwiki_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: cocanwiki_create_host.ml,v 1.1 2004/10/06 10:34:29 rich Exp $ + * $Id: cocanwiki_create_host.ml,v 1.2 2004/10/09 12:24:47 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 @@ -25,7 +25,7 @@ open Cgi open Printf let create_host dbh canonical_hostname hostnames template - title username password force_password_change = + title username password force_password_change email = let sth = dbh#prepare_cached "set constraints hosts_hostname_cn deferred" in sth#execute []; @@ -140,11 +140,12 @@ let create_host dbh canonical_hostname hostnames template ); (* Create the administrator user. *) + let email = match email with Some e -> `String e | None -> `Null in + let sth = dbh#prepare_cached "insert into users (hostid, name, password, - force_password_change, can_manage_users) - values (?, ?, ?, ?, - true)" in + force_password_change, email, can_manage_users) + values (?, ?, ?, ?, ?, true)" in sth#execute [`Int hostid; `String username; `String password; - `Bool force_password_change]; + `Bool force_password_change; email]; hostid diff --git a/scripts/cocanwiki_create_host.mli b/scripts/cocanwiki_create_host.mli index 5f38702..3eb7a58 100644 --- a/scripts/cocanwiki_create_host.mli +++ b/scripts/cocanwiki_create_host.mli @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: cocanwiki_create_host.mli,v 1.1 2004/10/06 10:34:29 rich Exp $ + * $Id: cocanwiki_create_host.mli,v 1.2 2004/10/09 12:24:48 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 @@ -20,4 +20,4 @@ *) val create_host : Dbi.connection -> string -> string list -> int -> - string -> string -> string -> bool -> int + string -> string -> string -> bool -> string option -> int -- 1.8.3.1