WE/DB/ComplexUser/AuthPOP3.pm

filter: Statementstmt 55.0% 11 / 20 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 41.1% 14 / 34 CC 4 SCAR 24.7
CC
4
Cov
41%
identify_POP3
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.9
« WE/DB.pm ↑ Summary WE/DB/ComplexUser/AuthPOP3S.pm »
1 # -*- perl -*-
2  
3 #
4 # $Id: AuthPOP3.pm,v 1.3 2005/05/11 09:28:27 eserte Exp $
5 # Author: Slaven Rezic
6 #
7 # Copyright (C) 2004 Slaven Rezic.
8 # This is free software; you can redistribute it and/or modify it under the
9 # terms of the GNU General Public License, see the file COPYING.
10  
11 #
12 # Mail: slaven@rezic.de
13 # WWW: http://we-framework.sourceforge.net
14 #
15  
16 package WE::DB::ComplexUser::AuthPOP3;
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use vars qw($VERSION $DEBUG);
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 $VERSION = sprintf("%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/);
21  
22 1 ▶use mixin::with 'WE::DB::ComplexUser';
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 0 ▶sub identify_POP3 {
Subroutine identify_POP3: not called CC=4 SCAR=30.0
Pod undocumented
25 0 my($self, $user, $password) = @_;
26  
27 0 my $host = $user->{Auth_POP3_Host}; # XXX || $self->default_pop3_host;
28 0 ▶ my $pop_user = $user->{Auth_POP3_User} || $user->Username;
Condition0%0/3
$user->{'Auth_POP3_User'} || $user->Username
l!l&&r!l&&!r
000
MC/DC0%0/2
$user->{'Auth_POP3_User'} || $user->Username
$user->{'Auth_POP3_User'} $user->Username
Truth table0%0/3
A || B
A= $user->{'Auth_POP3_User'}B= $user->Username
ABresult
1X1
011
000
29  
30 0 ▶ warn "Try pop3 with host=$host and user=$pop_user...\n" if $DEBUG;
Branch: 1 branch
BranchTrueFalseTotal
if $WE::DB::ComplexUser::AuthPOP3::DEBUG 0 0 0
31  
32 0 require Net::POP3;
33 0 my $pop = Net::POP3->new($host, Timeout => 10);
34 0 ▶ my $ret = $pop->login($pop_user, $password) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$pop->login($pop_user, $password) ? : 0 0 0
35 0 $pop->quit;
36 0 $ret;
37 }
38  
39 1 1;
40  
41 __END__
« WE/DB.pm ↑ Summary WE/DB/ComplexUser/AuthPOP3S.pm »