Allow username field to be prepopulated.
authorrich <rich>
Fri, 15 Oct 2004 12:47:17 +0000 (12:47 +0000)
committerrich <rich>
Fri, 15 Oct 2004 12:47:17 +0000 (12:47 +0000)
conf/cocanwiki.conf
scripts/login_form.ml
templates/login_form.html

index 02debf8..1936a6c 100644 (file)
@@ -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]
index dfef268..ec71c35 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * 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];
index f13e5b7..feba451 100644 (file)
@@ -18,7 +18,7 @@
 
 <tr>
 <th> Username: </th>
-<td> <input name="username" value="" size="32"/> </td>
+<td> <input name="username" value="::username_html_tag::" size="32"/> </td>
 </tr>
 
 <tr>