Auth/FTP.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran n/a Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 37 CC 1 SCAR 6.9
CC
1
Cov
0%
_init
2.0
auth
2.0
BEGIN
2.0
CRAP 2.0
1 # WWW:Auth::FTP
2 #
3 # Copyright (c) 2002 Jonathan A. Waxman <jowaxman@law.upenn.edu>
4 # All rights reserved.
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the same terms as Perl itself.
8  
9  
10 package WWW::Auth::FTP;
11 use base 'WWW::Auth::Base';
12  
13  
14 use strict;
15 use WWW::Auth::Config;
16 use Net::FTP;
17  
18  
19 sub _init {
20 my $self = shift;
21 my %params = @_;
22  
23 $self->{_ftphost} = $params{FTPHost} || WWW::Auth::Config->ftphost
24 || return $self->error ('No FTP host specified.');
25  
26 return 1;
27 }
28  
29 sub auth {
30 my $self = shift;
31 my ($uid, $pwd, %params) = @_;
32  
33 my $ftp = Net::FTP->new ($self->{_ftphost});
34 my $success = $ftp->login ($uid, $pwd);
35 $ftp->quit;
36  
37 return ($success, 'Username/Password incorrect');
38 }
39  
40  
41 1;