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

(-)a/installer/data/mysql/atomicupdate/bug_40596_add_cas_shibboleth_protocols.pl (+31 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "40596",
5
    description => "Add CAS and Shibboleth protocols to identity_providers enum",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Check if CAS and Shibboleth are already in the enum
11
        my $sth = $dbh->prepare("SHOW COLUMNS FROM identity_providers LIKE 'protocol'");
12
        $sth->execute();
13
        my $row = $sth->fetchrow_hashref();
14
15
        if ( $row && ( $row->{Type} !~ /CAS/ || $row->{Type} !~ /Shibboleth/ ) ) {
16
17
            # Add CAS and Shibboleth to the protocol enum
18
            $dbh->do(
19
                q{
20
                ALTER TABLE identity_providers
21
                MODIFY COLUMN protocol enum('OAuth','OIDC','LDAP','CAS','Shibboleth') NOT NULL
22
                COMMENT 'Protocol provider speaks'
23
            }
24
            );
25
26
            say $out "Added 'CAS' and 'Shibboleth' to identity_providers.protocol enum";
27
        } else {
28
            say $out "CAS and Shibboleth protocols already exist in identity_providers.protocol enum";
29
        }
30
    },
31
};
(-)a/installer/data/mysql/kohastructure.sql (-2 / +1 lines)
Lines 3614-3620 CREATE TABLE `identity_providers` ( Link Here
3614
  `identity_provider_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique key, used to identify the provider',
3614
  `identity_provider_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique key, used to identify the provider',
3615
  `code` varchar(20) NOT NULL COMMENT 'Provider code',
3615
  `code` varchar(20) NOT NULL COMMENT 'Provider code',
3616
  `description` varchar(255) NOT NULL COMMENT 'Description for the provider',
3616
  `description` varchar(255) NOT NULL COMMENT 'Description for the provider',
3617
  `protocol` enum('OAuth','OIDC','LDAP','CAS') NOT NULL COMMENT 'Protocol provider speaks',
3617
  `protocol` enum('OAuth','OIDC','LDAP','CAS','Shibboleth') NOT NULL COMMENT 'Protocol provider speaks',
3618
  `config` longtext NOT NULL COMMENT 'Configuration of the provider in JSON format',
3618
  `config` longtext NOT NULL COMMENT 'Configuration of the provider in JSON format',
3619
  `mapping` longtext NOT NULL COMMENT 'Configuration to map provider data to Koha user',
3619
  `mapping` longtext NOT NULL COMMENT 'Configuration to map provider data to Koha user',
3620
  `matchpoint` enum('email','userid','cardnumber') NOT NULL COMMENT 'The patron attribute to be used as matchpoint',
3620
  `matchpoint` enum('email','userid','cardnumber') NOT NULL COMMENT 'The patron attribute to be used as matchpoint',
3621
- 

Return to bug 40596