Bugzilla – Attachment 180014 Details for
Bug 39190
Rework new (S)FTP classes to be polymorphic classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39190: Update sftp_servers page to use new objects
Bug-39190-Update-sftpservers-page-to-use-new-objec.patch (text/plain), 4.14 KB, created by
Martin Renvoize (ashimema)
on 2025-03-31 12:27:07 UTC
(
hide
)
Description:
Bug 39190: Update sftp_servers page to use new objects
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-03-31 12:27:07 UTC
Size:
4.14 KB
patch
obsolete
>From e4653aad36c52c62c2df003124c8344281db8a10 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 24 Jan 2025 17:41:55 +0000 >Subject: [PATCH] Bug 39190: Update sftp_servers page to use new objects > >Similar to the previous commit, this time we're updating the page >controller to use the new polymorphic classes > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > admin/sftp_servers.pl | 27 ++++++++++----------------- > 1 file changed, 10 insertions(+), 17 deletions(-) > >diff --git a/admin/sftp_servers.pl b/admin/sftp_servers.pl >index 94be222ac5c..209d3a123e5 100755 >--- a/admin/sftp_servers.pl >+++ b/admin/sftp_servers.pl >@@ -27,6 +27,7 @@ use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); > > use Koha::SFTP::Servers; >+use Koha::File::Transports; > > my $input = CGI->new; > my $op = $input->param('op') || 'list'; >@@ -42,7 +43,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > > my @messages; > >-my $sftp_servers = Koha::SFTP::Servers->search; >+my $sftp_servers = Koha::File::Transports->search; > > if ( $op eq 'cud-add' ) { > my $name = $input->param('sftp_name'); >@@ -60,7 +61,7 @@ if ( $op eq 'cud-add' ) { > my $debug = ( scalar $input->param('sftp_debug_mode') ) ? 1 : 0; > > try { >- my $sftp_server = Koha::SFTP::Server->new( >+ my $sftp_server = Koha::File::Transport->new( > { > name => $name, > host => $host, >@@ -69,6 +70,8 @@ if ( $op eq 'cud-add' ) { > passive => $passive, > auth_mode => $auth_mode, > user_name => $user_name, >+ password => $password, >+ key_file => $key_file, > download_directory => $download_directory, > upload_directory => $upload_directory, > status => $status, >@@ -76,12 +79,6 @@ if ( $op eq 'cud-add' ) { > } > )->store; > >- $sftp_server->update_password($password) >- if ($password); >- >- $sftp_server->update_key_file($key_file) >- if ($key_file); >- > push @messages, { > type => 'message', > code => 'success_on_insert' >@@ -105,7 +102,7 @@ if ( $op eq 'cud-add' ) { > my $sftp_server_plain_text_password; > my $sftp_server_plain_text_key; > >- $sftp_server = Koha::SFTP::Servers->find($sftp_server_id) >+ $sftp_server = Koha::File::Transports->find($sftp_server_id) > unless !$sftp_server_id; > > unless ( !$sftp_server ) { >@@ -132,7 +129,7 @@ if ( $op eq 'cud-add' ) { > my $sftp_server_plain_text_password; > my $sftp_server; > >- $sftp_server = Koha::SFTP::Servers->find($sftp_server_id) >+ $sftp_server = Koha::File::Transports->find($sftp_server_id) > unless !$sftp_server_id; > > $sftp_server_plain_text_password = $sftp_server->plain_text_password >@@ -163,6 +160,8 @@ if ( $op eq 'cud-add' ) { > passive => $passive, > auth_mode => $auth_mode, > user_name => $user_name, >+ password => $password, >+ key_file => $key_file, > download_directory => $download_directory, > upload_directory => $upload_directory, > status => $status, >@@ -170,12 +169,6 @@ if ( $op eq 'cud-add' ) { > } > )->store; > >- $sftp_server->update_password($password) >- if ($password); >- >- $sftp_server->update_key_file($key_file) >- if ($key_file); >- > push @messages, { > type => 'message', > code => 'success_on_update' >@@ -204,7 +197,7 @@ if ( $op eq 'cud-add' ) { > my $sftp_server_id = $input->param('sftp_server_id'); > my $sftp_server; > >- $sftp_server = Koha::SFTP::Servers->find($sftp_server_id) >+ $sftp_server = Koha::File::Transports->find($sftp_server_id) > unless !$sftp_server_id; > > if ($sftp_server) { >-- >2.49.0
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 39190
:
178555
|
178556
|
178557
|
178558
|
178559
|
178560
|
178561
|
178562
|
178563
|
178564
|
178565
|
178566
|
178567
|
178568
|
178569
|
178570
|
178571
|
179252
|
179253
|
179254
|
179255
|
179256
|
179257
|
179258
|
179259
|
179260
|
179261
|
179262
|
179263
|
179264
|
179265
|
179266
|
179267
|
179268
|
179396
|
179397
|
179398
|
179399
|
179400
|
179401
|
179402
|
179403
|
179404
|
179405
|
179406
|
179407
|
179408
|
179409
|
179410
|
179411
|
179412
|
179413
|
179589
|
179590
|
179591
|
179592
|
179593
|
179594
|
179595
|
179596
|
179597
|
179598
|
179599
|
179600
|
179601
|
179602
|
179603
|
179604
|
179605
|
179606
|
179646
|
179647
|
179648
|
179649
|
179650
|
179651
|
179652
|
179653
|
179654
|
179655
|
179656
|
179657
|
179658
|
179659
|
179660
|
179661
|
179662
|
179663
|
179992
|
179993
|
179994
|
179995
|
179996
|
179997
|
179998
|
179999
|
180000
|
180001
|
180002
|
180003
|
180004
|
180005
|
180006
|
180010
|
180011
|
180012
|
180013
| 180014 |
180015
|
180016
|
180017
|
180018
|
180019
|
180020
|
180021
|
180022
|
180023
|
180024
|
180025