Bugzilla – Attachment 160719 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), 4.38 KB, created by
Alex Buckley
on 2024-01-09 18:58:03 UTC
(
hide
)
Description:
Bug 35724: Define non-standard ports for EDI SFTP in EDI accounts
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2024-01-09 18:58:03 UTC
Size:
4.38 KB
patch
obsolete
>From ed10668eca20d1b7a09af89b261cecbecb6eec3c 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 ++++ > admin/edi_accounts.pl | 2 ++ > koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt | 4 ++++ > 3 files changed, 10 insertions(+) > >diff --git a/Koha/Edifact/Transport.pm b/Koha/Edifact/Transport.pm >index c0ae452ef98..80f6cc9ecf9 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}->download_port ? $self->{account}->download_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}->upload_port ? $self->{account}->upload_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"); >diff --git a/admin/edi_accounts.pl b/admin/edi_accounts.pl >index 65e3b4e1a2a..c9f487cae90 100755 >--- a/admin/edi_accounts.pl >+++ b/admin/edi_accounts.pl >@@ -79,6 +79,8 @@ else { > host => scalar $input->param('host'), > username => scalar $input->param('username'), > password => $password, >+ upload_port => scalar $input->param('upload_port'), >+ download_port => scalar $input->param('download_port'), > vendor_id => scalar $input->param('vendor_id'), > upload_directory => scalar $input->param('upload_directory'), > download_directory => scalar $input->param('download_directory'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt >index 79a507d8d60..de2ee85be15 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/edi_accounts.tt >@@ -312,6 +312,8 @@ > <th>Remote host</th> > <th>Username</th> > <th>Password</th> >+ <th>Upload port</th> >+ <th>Download port</th> > <th>Download directory</th> > <th>Upload directory</th> > <th>Qualifier</th> >@@ -333,6 +335,8 @@ > <td>[% account.host | html %]</td> > <td>[% account.username | html %]</td> > <td>[% IF account.password %]*****[% END %]</td> >+ <td>[% account.upload_port | html %]</td> >+ <td>[% account.download_port | html %]</td> > <td>[% account.download_directory | html %]</td> > <td>[% account.upload_directory | html %]</td> > <td> >-- >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