| 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
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
| |||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | ▶ | warn "Try pop3 with host=$host and user=$pop_user...\n" if $DEBUG; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 35 | 0 | $pop->quit; | |||||||||||||||||||
| 36 | 0 | $ret; | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 1 | 1; | |||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | __END__ | ||||||||||||||||||||