Bugzilla – Attachment 160646 Details for
Bug 35724
Define non-standard port numbers for SFTP upload/download in EDI accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35724: Define non-standard ports for EDI SFTP in EDI accounts
Bug-35724-Define-non-standard-ports-for-EDI-SFTP-i.patch (text/plain), 2.53 KB, created by
Alex Buckley
on 2024-01-08 16:13:04 UTC
(
hide
)
Description:
Bug 35724: Define non-standard ports for EDI SFTP in EDI accounts
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2024-01-08 16:13:04 UTC
Size:
2.53 KB
patch
obsolete
>From d9a73521203738d2d9b8b69d58efb1e4eb580b0e Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Mon, 8 Jan 2024 14:47:37 +0000 >Subject: [PATCH] Bug 35724: Define non-standard ports for EDI SFTP in EDI > accounts > >Not all EDI vendors accept Koha servers connecting on port 22, sometimes >they require a different port to be used, so it would be helpful for >librarians to be able to configure non-standard EDI SFTP ports >themselves. > >Test plan: >1. Set EDIFACT syspref = 'Enable' and define a EDI account: Administration > Acquisition parameters > EDI >accounts. >2. Create an EDI order: https://koha-community.org/manual/latest/en/html/acquisitions.html#ordering-via-edi >3. Confirm you can upload the EDI order and download the vendor invoice. >4. Apply patches, update database, and restart services. >5. Go to the EDI account you made in #1. >6. Confirm there are two new fields: Upload port and Download port, both >have the value of 22. >7. Create a new EDI order. >8. Confirm you can upload the EDI order and download the vendor invoice. >9. Change the EDI account. Set the Download port = 10022. >10. Create a third EDI order. >11. Confirm you can upload the EDI order and download the vendor >invoice. > >Sponsored-by: Waikato Institute of Technology, New Zealand >--- > Koha/Edifact/Transport.pm | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/Koha/Edifact/Transport.pm b/Koha/Edifact/Transport.pm >index c0ae452ef98..d266dd7499c 100644 >--- a/Koha/Edifact/Transport.pm >+++ b/Koha/Edifact/Transport.pm >@@ -136,10 +136,12 @@ sub sftp_download { > # C = ready to retrieve E = Edifact > my $msg_hash = $self->message_hash(); > my @downloaded_files; >+ my $port = $self->{account}->{port} ? $self->{account}->{port} : '22'; > my $sftp = Net::SFTP::Foreign->new( > host => $self->{account}->host, > user => $self->{account}->username, > password => Koha::Encryption->new->decrypt_hex($self->{account}->password), >+ port => $port, > timeout => 10, > ); > if ( $sftp->error ) { >@@ -293,10 +295,12 @@ sub ftp_upload { > > sub sftp_upload { > my ( $self, @messages ) = @_; >+ my $port = $self->{account}->{port} ? $self->{account}->{port} : '22'; > my $sftp = Net::SFTP::Foreign->new( > host => $self->{account}->host, > user => $self->{account}->username, > password => Koha::Encryption->new->decrypt_hex($self->{account}->password), >+ port => $port, > timeout => 10, > ); > $sftp->die_on_error("Cannot ssh to $self->{account}->host"); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35724
:
160644
|
160645
|
160646
|
160717
|
160718
|
160719
|
160720
|
162494
|
162495
|
162496
|
162497
|
162498
|
162499