X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=cgi-auth-flexible.pm;h=ea833489876417d7e70d5a748caa4796a2105267;hb=d2386faae2eaf1ba830fa2d2c52a3d7f1e5d4b84;hp=f3f1599c462cbbbab0693f5c3c31e022bac77bf0;hpb=7adf4f57af7294ff5e94934d0af8b1113203f4e7;p=cgi-auth-flexible.git diff --git a/cgi-auth-flexible.pm b/cgi-auth-flexible.pm index f3f1599..ea83348 100644 --- a/cgi-auth-flexible.pm +++ b/cgi-auth-flexible.pm @@ -32,7 +32,7 @@ BEGIN { @EXPORT = qw(); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], - @EXPORT_OK = qw(setup); + @EXPORT_OK = qw(); } our @EXPORT_OK; @@ -47,6 +47,7 @@ use Digest; use Digest::HMAC; use Digest::SHA; use Data::Dumper; +use File::Copy; #---------- public utilities ---------- @@ -54,6 +55,7 @@ sub flatten_params ($) { my ($p) = @_; my @p; foreach my $k (keys %$p) { + next if $k eq ''; foreach my $v (@{ $p->{$k} }) { push @p, $k, $v; } @@ -92,8 +94,8 @@ sub login_ok_password ($$) { my $username_params = $r->{S}{username_param_names}; my $username = $r->_ch('get_param',$username_params->[0]); my $password = $r->_rp('password_param_name'); - return undef unless $r->_ch('username_password_ok', $username, $password); - return $username; + my $error = $r->_ch('username_password_error', $username, $password); + return defined($error) ? (undef,$error) : ($username,undef); } sub do_redirect_cgi ($$$$) { @@ -113,10 +115,13 @@ sub gen_some_form ($$) { # Calls $bodyfn->($c,$r) which returns @formbits my $c = $r->{Cgi}; my @form; + my $pathinfo = ''; + $pathinfo .= $params->{''}[0] if $params->{''}; push @form, ('