chiark / gitweb /
wip, before redo params
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 28 Dec 2012 13:39:21 +0000 (13:39 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 28 Dec 2012 13:39:21 +0000 (13:39 +0000)
cgi-auth-hybrid.pm

index 27cf367..35739b0 100644 (file)
@@ -85,18 +85,26 @@ sub do_redirect_cgi ($$$$) {
 }
 
 sub gen_plain_login_form ($$) {
-    my ($c,$r) = @_;
+    my ($c,$r, $params) = @_;
     my @form;
     push @form, ('<form method="POST" action="',
                 escapeHTML($r->_ch('get_url')).'>',
                 '<table>');
+    my $sz = 'size="'.$r->{S}{form_entry_size}.'"';
     foreach my $up (@{ $r->{S}{username_param_names}}) {
-       push @form, '<tr><td>'.$r->
-    push @form
-       '<table>'.
-       '<tr>'
-       '<input type="text" name="'
-       '<input type="text" name="'.$r->{S}{password_param_name}.'">'.
+       push @form, ('<tr><td>',$r->_gt(ucfirst $up),'</td>',
+                    '<td><input type="text" ',$sz,
+                    ' name=',$up,'></td></tr>');
+    }
+    push @form, ('<tr><td>'.$r->_gt('Password'),'</td>',
+                '<td><input type="password" ',$sz,
+                ' name="'.$r->{S}{password_param_name}.'"></td></tr>');
+    push @form, ('<tr><td colspan="2">',
+                '<input type="submit"'.
+                ' name="'.$r->{S}{login_submit_name}.'"',
+                ' value="'.$r->_gt('Login').'"></td></tr></table>');
+    foreach my $p (@$params) {
+       
 
 #---------- verifier object methods ----------
 
@@ -117,6 +125,7 @@ sub new_verifier {
            username_param_names => [qw(username)],
            form_entry_size => 60,
            logout_param_names => [qw(cah_logout)],
+           login_submit_name => [qw(cah_login)],
            loggedout_param_names => [qw(cah_loggedout)],
            promise_check_mutate => 0,
            get_param => sub { $_[0]->param($_[2]) },
@@ -529,7 +538,7 @@ sub check_ok ($) {
     if ($kind =~ m/^LOGIN-/) {
        $title = $r->_gt('Login');
        push @body, $r->_gt($divert->{Message});
-       push @body, $r->_ch('gen_login_form');
+       push @body, $r->_ch('gen_login_form', $params);
        $body .= $r->_ch(
 
        $r->_print(