X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FCGI%2FEx%2FAuth.pm;h=70d754e47f0bf7ba9d68d75001f2807cb1df00ef;hb=18123183bfb2737ea337306c9d705fca5b5e50d6;hp=fe9f776e125cb70732cdbeaf92c8609f33ed5816;hpb=8abbacc82b52f460bef67c1923ae98873a95e123;p=chaz%2Fp5-CGI-Ex diff --git a/lib/CGI/Ex/Auth.pm b/lib/CGI/Ex/Auth.pm index fe9f776..70d754e 100644 --- a/lib/CGI/Ex/Auth.pm +++ b/lib/CGI/Ex/Auth.pm @@ -18,7 +18,7 @@ use MIME::Base64 qw(encode_base64 decode_base64); use Digest::MD5 qw(md5_hex); use CGI::Ex; -$VERSION = '2.08'; +$VERSION = '2.18'; ###----------------------------------------------------------------### @@ -61,7 +61,7 @@ sub get_valid_auth { next if ! defined $hash->{$key}; $had_form_info ++ if $is_form; - ### if it looks like a bare username (as in they didn't have javascript)- add in other items + ### if it looks like a bare username (as in they didn't have javascript) - add in other items my $data; if ($is_form && $hash->{$key} !~ m|^[^/]+/| @@ -180,6 +180,7 @@ sub cookies { sub delete_cookie { my $self = shift; my $args = shift; + return $self->{'delete_cookie'}->($self, $args) if $self->{'delete_cookie'}; my $key = $args->{'key'}; $self->cgix->set_cookie({ -name => $key, @@ -193,6 +194,7 @@ sub delete_cookie { sub set_cookie { my $self = shift; my $args = shift; + return $self->{'set_cookie'}->($self, $args) if $self->{'set_cookie'}; my $key = $args->{'key'}; my $val = $args->{'val'}; $self->cgix->set_cookie({ @@ -207,6 +209,7 @@ sub set_cookie { sub location_bounce { my $self = shift; my $url = shift; + return $self->{'location_bounce'}->($self, $url) if $self->{'location_bounce'}; return $self->cgix->location_bounce($url); } @@ -484,7 +487,8 @@ sub generate_token { if ( (defined($data->{'use_plaintext'}) ? $data->{'use_plaintext'} : $self->use_plaintext) # ->use_plaintext is true if ->use_crypt is || (defined($data->{'use_crypt'}) && $data->{'use_crypt'}) || (defined($data->{'type'}) && $data->{'type'} eq 'crypt')) { - $token = $data->{'user'} .'/'. $data->{'real_pass'}; + my $pass = defined($data->{'test_pass'}) ? $data->{'test_pass'} : $data->{'real_pass'}; + $token = $data->{'user'} .'/'. $pass; ### all other types go to cram - secure_hash_cram, cram, plaintext and md5 } else { @@ -1150,8 +1154,12 @@ The text items shown in the default login template. The default values are: =back +=head1 LICENSE + +This module may be distributed under the same terms as Perl itself. + =head1 AUTHORS -Paul Seamons +Paul Seamons =cut