Branch Coverage

blib/lib/CGI/Auth.pm
Criterion Covered Total %
branch 23 164 14.0


line true false branch
333 0 1 unless $self->init(@_)
352 0 1 unless UNIVERSAL::isa($param, 'HASH')
358 0 1 $$param{-'admin'} ? :
364 1 1 if $_
368 0 1 if ($$self{'logintmpl'} = $$param{-'logintmpl'}) { }
380 0 1 $$param{-'cgiprune'} ? :
382 0 1 $$param{-'md5pwd'} ? :
384 0 1 if ($$self{'admin'}) { }
390 1 0 unless (UNIVERSAL::isa($$self{'cgi'}, 'CGI') or UNIVERSAL::isa($$self{'cgi'}, 'CGI::Simple'))
394 0 1 if ($@) { }
398 0 0 if ($@) { }
417 0 1 unless ($$self{'authdir'} and $$self{'admin'} || $$self{'formaction'} and $$self{'authfields'})
424 1 0 unless ($$self{'logintmpl'})
426 1 0 unless $$self{'loginheader'}
427 1 0 unless $$self{'loginfooter'}
429 1 0 unless $$self{'sessdir'}
430 1 0 unless $$self{'userfile'}
431 1 0 unless $$self{'timeout'}
433 0 1 if (-1 != index($$self{'validchars'}, ':'))
441 4 0 if ($_ and not ref $_ and not m[^/])
447 0 1 unless (-f $$self{'userfile'})
455 0 2 if ($$_{'id'} eq 'sess_file')
462 0 1 unless ($$self{'authfields'}[0]{'required'} and not $$self{'authfields'}[0]{'hidden'})
499 0 0 if ($session_file) { }
0 0 elsif (defined $$self{'cgi'}->param('auth_submit')) { }
507 0 0 if ($field0) { }
0 0 elsif (defined $field0) { }
529 0 0 unless (@userdata)
541 0 0 if ($$authfield{'required'})
544 0 0 if ($$authfield{'hidden'}) { }
547 0 0 if ($$self{'md5pwd'}) { }
550 0 0 if (MD5Crypt($formvalue) ne $userdata[$idx])
558 0 0 if (DoubleCrypt($formvalue, $userdata[$idx]) ne $userdata[$idx])
567 0 0 if ($userdata[$idx] ne $formvalue)
575 0 0 if ($@) { }
583 0 0 if ($$self{'sess_file'} = $self->CreateSessionFile($field0)) { }
617 0 0 if (-f $$self{'sessdir'} . '/' . $$self{'sess_file'}) { }
640 0 0 if @data != @{$$self{'authfields'};}
644 0 0 if $$self{'authfields'}[$idx]{'hidden'}
668 0 0 if ($key eq 'sess_file')
786 0 0 if @userdata != @{$$self{'authfields'};}
789 0 0 unless open USER, '>> ' . $$self{'userfile'}
794 0 0 if ($$authfield{'hidden'})
796 0 0 if ($$self{'md5pwd'}) { }
802 0 0 if (length $userdata[$idx] > 16)
829 0 0 unless open USER, '< ' . $$self{'userfile'}
854 0 0 if (@userdata == 0)
859 0 0 if @userdata != @{$$self{'authfields'};}
864 0 0 if $$self{'authfields'}[$idx]{'required'}
865 0 0 if $$self{'authfields'}[$idx]{'hidden'}
892 0 0 if ($resp =~ /^[yY]/) { }
894 0 0 unless open USER, '< ' . $$self{'userfile'}
898 0 0 unless open USER, '> ' . $$self{'userfile'}
901 0 0 unless (/^$field0\b/i)
928 0 0 unless $$self{'cgiprune'}
936 0 0 unless -f $file
942 0 0 if $age > $$self{'timeout'}
973 0 0 unless ($field0)
978 0 0 unless (open USER, '< ' . $$self{'userfile'})
988 0 0 unless /^$fzero/i
996 0 0 if (lc $userdata[0] ne lc $field0)
1023 0 0 if ($$self{'logintmpl'}) { }
1053 0 0 unless (UNIVERSAL::isa($template, 'HTML::Template'))
1057 0 0 UNIVERSAL::isa($template, 'HASH') ? :
1069 0 0 if ($$authfield{'required'})
1071 0 0 $$authfield{'hidden'} ? :
1102 0 0 if (open HEADER, '< ' . $$self{'loginheader'}) { }
1120 0 0 if ($msg)
1136 0 0 if ($$authfield{'required'})
1138 0 0 if ($$authfield{'hidden'}) { }
1157 0 0 if (open FOOTER, '< ' . $$self{'loginfooter'}) { }
1190 0 0 if $name =~ /^auth_/
1193 0 0 if (@values < 2) { }
1237 0 0 unless open SESS, '> ' . $$self{'sessdir'} . "/$sessfilename"
1240 0 0 if $remoteaddr
1277 0 0 if (-f $sessfile)
1284 0 0 if ($age > $$self{'timeout'})
1292 0 0 if (open SESS, "< $sessfile")
1302 0 0 if ($field0 =~ /^([$validchars]+)$/) { }
1317 0 0 if ($file_ra and $file_ra ne $ENV{'REMOTE_ADDR'})
1359 0 0 if ($ENV{'GATEWAY_INTERFACE'} or $ENV{'REQUEST_METHOD'} or $ENV{'REMOTE_ADDR'})
1388 0 0 if (length $str > 8) { }