X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=scripts%2Fcocanwiki_create_host.ml;h=981f978695a4ec604119e97dde0442ee6fd2c04d;hb=c0d8bbfd20d6fbf7d9176c5825b8943d3d2891a9;hp=b528efd07af3d82ad145794f009fd571c0878c0b;hpb=253dcc86ed026e18643f07559009b1d50ea5b800;p=cocanwiki.git 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