home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl_ste.zip / auto / Net / FTP / authorize.al < prev    next >
Text File  |  1997-11-28  |  624b  |  32 lines

  1. # NOTE: Derived from ./blib/lib/Net/FTP.pm.  Changes made here will be lost.
  2. package Net::FTP;
  3.  
  4. sub authorize
  5. {
  6.  @_ >= 1 || @_ <= 3 or croak 'usage: $ftp->authorize( [AUTH [, RESP]])';
  7.  
  8.  my($ftp,$auth,$resp) = @_;
  9.  
  10.  unless(defined $resp)
  11.   {
  12.    require Net::Netrc;
  13.  
  14.    $auth ||= (getpwuid($>))[0];
  15.  
  16.    my $rc = Net::Netrc->lookup(${*$ftp}{'net_ftp_firewall'}, $auth)
  17.         || Net::Netrc->lookup(${*$ftp}{'net_ftp_firewall'});
  18.  
  19.    ($auth,$resp) = $rc->lpa()
  20.      if($rc);
  21.   }
  22.  
  23.  my $ok = $ftp->_AUTH($auth || "");
  24.  
  25.  $ok = $ftp->_RESP($resp || "")
  26.     if ($ok == CMD_MORE);
  27.  
  28.  $ok == CMD_OK;
  29. }
  30.  
  31. 1;
  32.