View | Details | Raw Unified | Return to bug 35724
Collapse All | Expand All

(-)a/Koha/Edifact/Transport.pm (-9 / +16 lines)
Lines 219-231 sub ftp_download { Link Here
219
219
220
    my $msg_hash = $self->message_hash();
220
    my $msg_hash = $self->message_hash();
221
    my @downloaded_files;
221
    my @downloaded_files;
222
    my $ftp = Net::FTP->new(
222
    my $port = $self->{account}->download_port ? $self->{account}->download_port : '21';
223
    my $ftp  = Net::FTP->new(
223
        $self->{account}->host,
224
        $self->{account}->host,
225
        Port    => $port,
224
        Timeout => 10,
226
        Timeout => 10,
225
        Passive => 1
227
        Passive => 1
226
      )
228
        )
227
      or return $self->_abort_download( undef,
229
        or return $self->_abort_download(
228
        "Cannot connect to $self->{account}->host: $EVAL_ERROR" );
230
        undef,
231
        "Cannot connect to $self->{account}->host: $EVAL_ERROR"
232
        );
229
    $ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex($self->{account}->password) )
233
    $ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex($self->{account}->password) )
230
      or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" );
234
      or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" );
231
    $ftp->cwd( $self->{account}->download_directory )
235
    $ftp->cwd( $self->{account}->download_directory )
Lines 260-272 sub ftp_download { Link Here
260
264
261
sub ftp_upload {
265
sub ftp_upload {
262
    my ( $self, @messages ) = @_;
266
    my ( $self, @messages ) = @_;
263
    my $ftp = Net::FTP->new(
267
    my $port = $self->{account}->upload_port ? $self->{account}->upload_port : '21';
268
    my $ftp  = Net::FTP->new(
264
        $self->{account}->host,
269
        $self->{account}->host,
270
        Port    => $port,
265
        Timeout => 10,
271
        Timeout => 10,
266
        Passive => 1
272
        Passive => 1
267
      )
273
        )
268
      or return $self->_abort_download( undef,
274
        or return $self->_abort_download(
269
        "Cannot connect to $self->{account}->host: $EVAL_ERROR" );
275
        undef,
276
        "Cannot connect to $self->{account}->host: $EVAL_ERROR"
277
        );
270
    $ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex($self->{account}->password) )
278
    $ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex($self->{account}->password) )
271
      or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" );
279
      or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" );
272
    $ftp->cwd( $self->{account}->upload_directory )
280
    $ftp->cwd( $self->{account}->upload_directory )
273
- 

Return to bug 35724