(* 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.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
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 ()
);
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 ()
);
(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
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