Branch Coverage

blib/lib/CGI/AuthRegister.pm
Criterion Covered Total %
branch 1 490 0.2


line true false branch
83 0 0 if (-r 'configuration.pl')
92 0 0 if ($ENV{'HTTPS'} ne 'on')
110 0 0 if ($querystring eq '' and param('querystring'))
112 0 0 if ($querystring eq 'cas-all.css')
113 0 0 if ($querystring eq 'cas-mobile.css')
115 0 0 if (param('rt') ne '' and param('rt') eq 'verify')
119 0 0 if ($r ne '' and $r->{'stoken'} eq $stoken and $r->{'userid'} eq $username)
121 0 0 if ($CGI::AuthRegister::DebugLevel > 5)
124 0 0 if ($ans ne 'ok')
126 0 0 if ($CGI::AuthRegister::DebugLevel > 5)
134 0 0 if (param('redirect_uri') ne '') { }
0 0 elsif (param('r') ne '') { }
141 0 0 if ($redirect_uri ne '')
155 0 0 if ($redirect_uri ne '')
162 0 0 if ($redirect_uri ne '') { }
165 0 0 unless (-f $f or &check_db_files)
167 0 0 unless (-f $f)
169 0 0 if ($CGI::AuthRegister::Error ne '')
187 0 0 if ($redirect_uri ne '' and not $redirect_uri =~ m[^https://(\w|[-.~/])+]i and not $redirect_uri =~ m[^http://(\w|[-.~/:])+]i)
207 0 0 if ($querystring eq 'forgotpwd' or param('rt') eq 'forgotpwd')
208 0 0 if ($CGI::AuthRegister::LinkForgotpwd)
236 0 0 if ($CGI::AuthRegister::SessionId ne '' and param('keywords') eq 'logout')
239 0 0 if ($CGI::AuthRegister::SessionId ne '')
243 0 0 if ($Request_type eq 'Login') { }
0 0 elsif ($Request_type eq 'Send_Password') { }
247 0 0 if (not &login($username, $password)) { }
250 0 0 if ($redirect_uri ne '')
286 0 0 if exists $args{'-cas'}
291 0 0 $a =~ /password/i ? :
299 0 0 $CGI::AuthRegister::AllowSignup ? :
317 0 0 if ($CGI::AuthRegister::SessionId ne '' and param('keywords') eq 'logout')
321 0 0 if ($CGI::AuthRegister::SessionId ne '')
323 0 0 if (param('keywords') eq 'signup' and $CGI::AuthRegister::AllowSignup) { }
0 0 elsif (param('confirmation_code')) { }
333 0 0 if ($Request_type eq 'Login') { }
0 0 elsif ($Request_type eq 'Send_Password') { }
0 0 elsif ($Request_type eq 'Reset_Password') { }
0 0 elsif ($Request_type eq 'Register' and $CGI::AuthRegister::AllowSignup) { }
337 0 0 if (not &login($email, $password)) { }
381 0 0 if exists $args{'-return_status'}
389 0 0 if ($CGI::AuthRegister::SessionId ne '' and param('keywords') eq 'logout')
391 0 0 if ($retStatus)
394 0 0 if ($CGI::AuthRegister::SessionId ne '')
396 0 0 if ($header_no_print)
400 0 0 if ($request_type ne 'Proceed')
401 0 0 if ($retStatus)
405 0 0 if ($username eq '' or $stoken eq '')
406 0 0 if ($retStatus)
409 0 0 unless ($casurl =~ m[^https://]i)
418 0 0 if ($resp->is_success) { }
420 0 0 if ($message eq 'answer:ok') { }
426 0 0 if ($result ne 'ok')
429 0 0 if ($retStatus)
431 0 0 $CGI::AuthRegister::AddAuthenticatedUser ? :
433 0 0 if ($u eq '')
436 0 0 if ($retStatus)
448 0 0 if (exists $args{'-redirect'} and $args{'-redirect'} ne '' and $args{'-redirect'} ne $ENV{'SCRIPT_NAME'})
451 0 0 if (exists $args{'-back'} and $args{'-back'})
455 0 0 if ($CGI::AuthRegister::SessionId eq '')
456 0 0 if ($ENV{'SCRIPT_NAME'} eq $defaultcgi)
467 0 0 if ($redirect ne '') { }
468 0 0 if ($CGI::AuthRegister::SessionId eq '') { }
475 0 0 if ($CGI::AuthRegister::SessionId eq '') { }
492 0 0 if ($CGI::AuthRegister::DebugLevel > 5)
493 0 0 if ($c eq '')
495 0 0 unless ($CGI::AuthRegister::SessionId =~ /^[\w.:-]+$/ and $CGI::AuthRegister::Ticket =~ /^\w+$/)
500 0 0 unless (-f $sessioninfofile)
502 0 0 if (not ref $se or $CGI::AuthRegister::Ticket ne $se->{'Ticket'})
506 0 0 if ($CGI::AuthRegister::UserEmail =~ /@/) { }
0 0 elsif ($CGI::AuthRegister::UserId ne '') { }
509 0 0 if ($CGI::AuthRegister::UserId ne '' and $CGI::AuthRegister::User->{'userid'} ne $CGI::AuthRegister::UserId)
511 0 0 if ($CGI::AuthRegister::Error ne '')
514 0 0 if ($CGI::AuthRegister::Error ne '')
525 0 0 unless ($reg_userid =~ /^(\w|[.-])+$/)
528 0 0 unless (&emailcheckok($reg_email))
529 0 0 if ($reg_password eq '')
530 0 0 if ($reg_password ne $reg_password2)
534 0 0 unless (-f $dbf or &check_db_files)
535 0 0 unless (&lock_mkdir($dbf))
537 0 0 if (ref $db_ref ne 'ARRAY')
544 0 0 if ($u->{'userid'} eq $reg_userid)
545 0 0 if ($u->{'email'} eq $reg_email)
553 0 0 if ($CGI::AuthRegister::Error)
569 0 0 unless (-f $dbf or &check_db_files)
570 0 0 unless (&lock_mkdir($dbf))
572 0 0 if (ref $db_ref ne 'ARRAY')
576 0 0 if (defined $u->{'status'} and $u->{'status'} =~ /^disabled, waiting for confirmation code (\S+)/ and $1 eq $confirmation_code)
582 0 0 unless ($flag)
595 0 0 if $pwstore eq ''
597 0 0 unless (-f $pwdf)
598 0 0 unless (&lock_mkdir($pwdf))
599 0 0 unless open PH, $pwdf
603 0 0 if $e ne $email
607 0 0 if ($pwstore eq 'raw') { }
0 0 elsif ($pwstore eq 'md5') { }
618 0 0 if $pwstoretype eq ''
620 0 0 unless (&check_db_files)
621 0 0 unless (&lock_mkdir($pwdf))
622 0 0 unless open PH, $pwdf
624 0 0 if ($pwstoretype eq 'md5') { }
629 0 0 if ($e eq $email) { }
641 0 0 unless $n > 0
649 0 0 if ($CGI::AuthRegister::Session eq '')
650 0 0 if (not -d "$CGI::AuthRegister::DBdir/$CGI::AuthRegister::DBsessions/$CGI::AuthRegister::SessionId") { }
663 0 0 unless ($email =~ /@/)
664 0 0 if ($email ne '') { }
665 0 0 unless (&emailcheckok($email))
669 0 0 if ($u eq '')
673 0 0 if ($userid eq '')
674 0 0 if ($CGI::AuthRegister::LDAPuse and $CGI::AuthRegister::LDAPaddUsers)
677 0 0 if ($u eq '')
684 0 0 unless (password_check($CGI::AuthRegister::User, $password))
694 0 0 unless (&password_check_ldap($userid, $password))
697 0 0 if ($u eq '')
710 0 0 unless ($email =~ /@/ or $userid =~ /\w/)
713 0 0 unless (-d $sDir or &check_db_files)
719 0 0 unless (mkdir "$sDir/$sessionid", 448)
721 0 0 if $cnt == 100
726 0 0 if $email ne ''
727 0 0 if $userid ne ''
732 0 0 unless ref $CGI::AuthRegister::Session
739 0 0 if (defined $u->{'status'} and $u->{'status'} =~ /^\s*disabled\b/)
741 0 0 if ($CGI::AuthRegister::LDAPuse)
743 0 0 if ($pwstored =~ /^raw:/)
744 0 0 $pwstored eq $password ? :
745 0 0 if ($pwstored =~ /^md5:/)
746 0 0 $pwstored eq md5_base64($password) ? :
754 0 0 if ($username eq '' or $CGI::AuthRegister::LDAPserver eq '' or $CGI::AuthRegister::LDAPdn eq '')
757 0 0 if ($@)
760 0 0 unless my $ldap = 'Net::LDAP'->new("ldaps://$CGI::AuthRegister::LDAPserver")
762 0 0 if ($mesg->code == 0)
776 0 0 unless (-f $pwfile or &check_db_files)
777 0 0 unless (&lock_mkdir($pwfile))
778 0 0 unless (open PH, $pwfile)
782 0 0 if ($e eq $email)
792 0 0 unless $n > 0
801 1 0 unless $n > 0
807 0 0 if ($#_ >= -1)
808 0 0 if $CGI::AuthRegister::LogReport eq ''
809 0 0 if ($CGI::AuthRegister::SendLogs)
820 0 0 if ($email eq '')
822 0 0 unless (emailcheckok($email))
825 0 0 if ($user eq '')
836 0 0 if ($email eq '')
839 0 0 if ($email =~ /@/) { }
841 0 0 if ($user eq '')
844 0 0 unless (emailcheckok($email))
847 0 0 if ($pw =~ /^raw:/) { }
0 0 elsif ($pw ne '') { }
871 0 0 if $CGI::AuthRegister::Email_bcc eq ''
873 0 0 unless $CGI::AuthRegister::Email_from eq ''
880 0 0 unless &emailcheckok($email)
882 0 0 unless ($subject =~ /^Subject: /)
886 0 0 unless $CGI::AuthRegister::Email_from eq ''
888 0 0 unless $CGI::AuthRegister::Email_bcc eq ''
895 0 0 unless (-x $CGI::AuthRegister::Sendmail)
898 0 0 unless (open S, "|$CGI::AuthRegister::Sendmail -ti")
930 0 0 if ($email =~ /^[a-zA-Z][\w\.+-]*[a-zA-Z0-9+-]@ [a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/x)
937 0 0 if $userid =~ /^[a-zA-Z0-9-]+$/
943 0 0 unless (-f $f)
948 0 0 unless $k =~ /^k=/
950 0 0 if (ref $db_ref ne 'ARRAY')
954 0 0 if (exists $r->{$k} and $v eq $r->{$k})
961 0 0 if (ref $db_ref ne 'ARRAY')
967 0 0 if (exists $r->{$k} and $v eq $r->{$k})
974 0 0 if (ref $db_ref ne 'ARRAY')
978 0 0 if (lc $email eq lc $r->{'email'})
987 0 0 unless (-f $f or &check_db_files)
991 0 0 unless exists $r->{'userid'}
993 0 0 unless $v1 eq $userid
994 0 0 if ($u eq '')
997 0 0 unless $u eq ''
1006 0 0 unless (-f $f or &check_db_files)
1009 0 0 if ($k eq '' or $v eq '')
1013 0 0 unless exists $r->{$k}
1015 0 0 unless $v eq $v1
1016 0 0 if ($u eq '')
1019 0 0 unless $u eq ''
1025 0 0 unless (-d $CGI::AuthRegister::DBdir)
1026 0 0 unless ($ret)
1027 0 0 unless (-f $pwfile)
1028 0 0 unless (-f $pwfile)
1031 0 0 unless (-f $f)
1033 0 0 unless (-f $f)
1035 0 0 unless (-d $f)
1036 0 0 unless ($ret)
1047 0 0 if ($arg =~ /^file=/)
1048 0 0 if $file eq ''
1049 0 0 unless open F, $file
1057 0 0 if ($arg =~ /^(\s*\n|[ \t]*#.*\n)*/)
1059 0 0 if ($arg =~ /\n(\n+)/) { }
1061 0 0 if ($dbi > $#{$db;})
1065 0 0 if ($record =~ /^.*/)
1068 0 0 unless $record =~ /^([^\n:]*):(.*)\n/
1071 0 0 if (exists $r->{$k})
1077 0 0 if (exists $db->[$dbi]{$k} and $db->[$dbi]{$k} eq $v) { }
0 0 elsif (exists $db->[$dbi]{$k}) { }
1086 0 0 unless (exists $savedkeys{$k})
1103 0 0 if ($file ne '') { }
1104 0 0 if ($argcopy ne $arg_save)
1114 0 0 unless $kdel =~ /^k=/
1115 0 0 unless (&lock_mkdir($dbf))
1116 0 0 unless (open F, $dbf)
1123 0 0 if ($arg =~ /^([ \t\r]*(#.*)?\n)+/)
1125 0 0 if $arg eq ''
1126 0 0 if ($arg =~ /([ \t\r]*\n){2,}/) { }
1131 0 0 unless $record =~ /^[ \t]*([^\n:]*?)[ \t]*:/
1135 0 0 unless $record =~ /^[ \t]*(.*?)[ \t\r]*\n/
1137 0 0 if (exists $r->{$k})
1144 0 0 if (exists $r->{$kdel} and $r->{$kdel} eq $vdel) { }
1148 0 0 if ($argcopy ne $arg_save)
1149 0 0 unless (open F, ">$dbf.lock/new")
1159 0 0 if ($arg =~ /^file=/)
1160 0 0 unless (&lock_mkdir($f))
1162 0 0 unless (open F, $f)
1171 0 0 if ($arg =~ /\n\n+/) { }
1175 0 0 if ($record =~ /^#.*\n?/)
1178 0 0 unless $record =~ /^([^\n:]*):(.*)\n/
1180 0 0 if (exists $r->{$k})
1196 0 0 unless (&lock_mkdir($fdb))
1197 0 0 unless (open F, ">>$fdb")
1206 0 0 if ($arg =~ /^file=/)
1207 0 0 unless open F, $f
1213 0 0 if ($arg =~ /\n\n+/) { }
1219 0 0 unless $record =~ /^([^\n:]*):(.*)\n/
1221 0 0 if (exists $r->{$k})
1234 0 0 if $n < 1
1241 0 0 unless (open F, ">$f")
1247 0 0 unless (open F, "<$f")
1250 0 0 wantarray ? :
1261 0 0 if (not -e $lockd and $locked = mkdir($lockd, 448))
1266 0 0 unless -e $lockd
1267 0 0 if ($locked)
1276 0 0 unless (-e $lockd)
1277 0 0 if (-d $lockd)
1278 0 0 if (-f $lockd or -l $lockd)
1483 0 0 if ($CGI::AuthRegister::GenCasPageCustom ne '')
1491 0 0 if (param('redirect_uri') ne '') { }
0 0 elsif (param('r') ne '') { }
1500 0 0 if ($forgotpassword)
1502 0 0 if ($CGI::AuthRegister::SessionId ne '')
1507 0 0 if ($removerighthandside) { }
1519 0 0 if ($par eq 'cas-all.css') { }
0 0 elsif ($par eq 'cas-mobile.css') { }
2134 0 0 unless $CGI::AuthRegister::DebugLevel > 5