From 22c5eb291c13270f17f2cee76b760634f230347e Mon Sep 17 00:00:00 2001 From: rich Date: Fri, 15 Oct 2004 12:47:17 +0000 Subject: [PATCH] Allow username field to be prepopulated. --- conf/cocanwiki.conf | 4 ++-- scripts/login_form.ml | 5 ++++- templates/login_form.html | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/conf/cocanwiki.conf b/conf/cocanwiki.conf index 02debf8..1936a6c 100644 --- a/conf/cocanwiki.conf +++ b/conf/cocanwiki.conf @@ -1,5 +1,5 @@ # Apache configuration for COCANWIKI. -# $Id: cocanwiki.conf,v 1.13 2004/10/14 15:57:15 rich Exp $ +# $Id: cocanwiki.conf,v 1.14 2004/10/15 12:47:17 rich Exp $ # Uncomment the following lines if necessary. You will probably need # to adjust the paths to reflect where cocanwiki is really installed. @@ -58,7 +58,7 @@ RewriteRule ^/_files$ /_bin/files.cmo [PT,L,QSA] RewriteRule ^/_global.css$ /_bin/hoststyle.cmo [PT,L,QSA] RewriteRule ^/_images$ /_bin/images.cmo [PT,L,QSA] RewriteRule ^/_invite$ /_bin/invite_user_confirm_form.cmo [PT,L,QSA] -RewriteRule ^/_login$ /_bin/login_form.cmo [PT,L] +RewriteRule ^/_login$ /_bin/login_form.cmo [PT,L,QSA] RewriteRule ^/_logout$ /_bin/logout.cmo [PT,L,QSA] RewriteRule ^/_mailing_list.csv$ /_bin/mailing_list_view.cmo?csv=1 [PT,L] RewriteRule ^/_ml_confirm$ /_bin/mailing_list_confirm.cmo [PT,L,QSA] diff --git a/scripts/login_form.ml b/scripts/login_form.ml index dfef268..ec71c35 100644 --- a/scripts/login_form.ml +++ b/scripts/login_form.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: login_form.ml,v 1.4 2004/09/09 12:21:22 rich Exp $ + * $Id: login_form.ml,v 1.5 2004/10/15 12:47:18 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 @@ -40,6 +40,9 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid _ _ = template#set "redirect" redirect ); + let username = try q#param "username" with Not_found -> "" in + template#set "username" username; + let sth = dbh#prepare_cached "select create_account_anon from hosts where id = ?" in sth#execute [`Int hostid]; diff --git a/templates/login_form.html b/templates/login_form.html index f13e5b7..feba451 100644 --- a/templates/login_form.html +++ b/templates/login_form.html @@ -18,7 +18,7 @@ Username: - + -- 1.8.3.1