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

(-)a/installer/data/mysql/atomicupdate/bug_35761-add_SFTP_tables_and_perm.pl (+44 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35761",
5
    description => "Add new table and permission for generalised SFTP",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(
11
            q{
12
                INSERT IGNORE INTO permissions (module_bit, code, description)
13
                VALUES (3, 'manage_sftp_servers', 'Manage FTP/SFTP servers configuration');
14
            }
15
        );
16
        say $out "Added new manage_sftp_servers permission";
17
18
        unless ( TableExists('sftp_servers') ) {
19
            $dbh->do(
20
                q {
21
                    CREATE TABLE `sftp_servers` (
22
                    `id` int(11) NOT NULL AUTO_INCREMENT,
23
                    `name` varchar(80) NOT NULL,
24
                    `host` varchar(80) NOT NULL DEFAULT 'localhost',
25
                    `port` int(11) NOT NULL DEFAULT 22,
26
                    `transport` enum('ftp','sftp') NOT NULL DEFAULT 'sftp',
27
                    `passive` tinyint(1) NOT NULL DEFAULT 1,
28
                    `user_name` varchar(80) DEFAULT NULL,
29
                    `password` mediumtext DEFAULT NULL,
30
                    `key_file` mediumtext DEFAULT NULL,
31
                    `auth_mode` enum('password','key_file','noauth') NOT NULL DEFAULT 'password',
32
                    `download_directory` mediumtext DEFAULT NULL,
33
                    `upload_directory` mediumtext DEFAULT NULL,
34
                    `status` varchar(32) DEFAULT NULL,
35
                    `debug` tinyint(1) NOT NULL DEFAULT 0,
36
                    PRIMARY KEY (`id`),
37
                    KEY `host_idx` (`host`)
38
                    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
39
                }
40
            );
41
            say $out "Added new sftp_servers table";
42
        }
43
    },
44
};
(-)a/installer/data/mysql/kohastructure.sql (+27 lines)
Lines 5964-5969 CREATE TABLE `sessions` ( Link Here
5964
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5964
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5965
/*!40101 SET character_set_client = @saved_cs_client */;
5965
/*!40101 SET character_set_client = @saved_cs_client */;
5966
5966
5967
--
5968
-- Table structure for table `sftp_servers`
5969
--
5970
5971
DROP TABLE IF EXISTS `sftp_servers`;
5972
/*!40101 SET @saved_cs_client     = @@character_set_client */;
5973
/*!40101 SET character_set_client = utf8 */;
5974
CREATE TABLE `sftp_servers` (
5975
  `id` int(11) NOT NULL AUTO_INCREMENT,
5976
  `name` varchar(80) NOT NULL,
5977
  `host` varchar(80) NOT NULL DEFAULT 'localhost',
5978
  `port` int(11) NOT NULL DEFAULT 22,
5979
  `transport` enum('ftp','sftp') NOT NULL DEFAULT 'sftp',
5980
  `passive` tinyint(1) NOT NULL DEFAULT 1,
5981
  `user_name` varchar(80) DEFAULT NULL,
5982
  `password` mediumtext DEFAULT NULL,
5983
  `key_file` mediumtext DEFAULT NULL,
5984
  `auth_mode` enum('password','key_file','noauth') NOT NULL DEFAULT 'password',
5985
  `download_directory` mediumtext DEFAULT NULL,
5986
  `upload_directory` mediumtext DEFAULT NULL,
5987
  `status` varchar(32) DEFAULT NULL,
5988
  `debug` tinyint(1) NOT NULL DEFAULT 0,
5989
  PRIMARY KEY (`id`),
5990
  KEY `host_idx` (`host`)
5991
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5992
/*!40101 SET character_set_client = @saved_cs_client */;
5993
5967
--
5994
--
5968
-- Table structure for table `sms_providers`
5995
-- Table structure for table `sms_providers`
5969
--
5996
--
(-)a/installer/data/mysql/mandatory/userpermissions.sql (-2 / +2 lines)
Lines 39-44 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
39
   ( 3, 'manage_additional_fields', 'Add, edit, or delete additional custom fields for baskets or subscriptions (also requires order_manage or edit_subscription permissions)'),
39
   ( 3, 'manage_additional_fields', 'Add, edit, or delete additional custom fields for baskets or subscriptions (also requires order_manage or edit_subscription permissions)'),
40
   ( 3, 'manage_keyboard_shortcuts', 'Manage keyboard shortcuts for the advanced cataloging editor'),
40
   ( 3, 'manage_keyboard_shortcuts', 'Manage keyboard shortcuts for the advanced cataloging editor'),
41
   ( 3, 'manage_smtp_servers', 'Manage SMTP servers configuration'),
41
   ( 3, 'manage_smtp_servers', 'Manage SMTP servers configuration'),
42
   ( 3, 'manage_sftp_servers', 'Manage FTP/SFTP servers configuration'),
42
   ( 3, 'manage_background_jobs', 'Manage background jobs'),
43
   ( 3, 'manage_background_jobs', 'Manage background jobs'),
43
   ( 3, 'manage_curbside_pickups', 'Manage curbside pickups'),
44
   ( 3, 'manage_curbside_pickups', 'Manage curbside pickups'),
44
   ( 3, 'manage_search_filters', 'Manage custom search filters'),
45
   ( 3, 'manage_search_filters', 'Manage custom search filters'),
Lines 164-167 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
164
   (25, 'takepayment', 'Access the point of sale page and take payments'),
165
   (25, 'takepayment', 'Access the point of sale page and take payments'),
165
   (26, 'manage_problem_reports', 'Manage OPAC problem reports'),
166
   (26, 'manage_problem_reports', 'Manage OPAC problem reports'),
166
   (27, 'manage_recalls', 'Manage recalls for patrons')
167
   (27, 'manage_recalls', 'Manage recalls for patrons')
167
;
168
;
168
- 

Return to bug 35761