Lines 20843-20848
if ( CheckVersion($DBversion) ) {
Link Here
|
20843 |
SetVersion ($DBversion); |
20843 |
SetVersion ($DBversion); |
20844 |
} |
20844 |
} |
20845 |
|
20845 |
|
|
|
20846 |
$DBversion = "19.11.23.001"; |
20847 |
if ( CheckVersion($DBversion) ) { |
20848 |
|
20849 |
require Koha::AuthUtils; |
20850 |
|
20851 |
my $sth = $dbh->prepare(q{ |
20852 |
SELECT client_id, secret |
20853 |
FROM api_keys |
20854 |
}); |
20855 |
$sth->execute; |
20856 |
my $results = $sth->fetchall_arrayref({}); |
20857 |
|
20858 |
$sth = $dbh->prepare(q{ |
20859 |
UPDATE api_keys |
20860 |
SET |
20861 |
secret = ? |
20862 |
WHERE |
20863 |
client_id = ? |
20864 |
}); |
20865 |
|
20866 |
foreach my $api_key (@$results) { |
20867 |
unless ( $api_key->{secret} =~ m/^\$2a\$08\$/ ) { |
20868 |
my $digest = Koha::AuthUtils::hash_password( $api_key->{secret} ); |
20869 |
$sth->execute( $digest, $api_key->{client_id} ); |
20870 |
} |
20871 |
} |
20872 |
|
20873 |
print "Upgrade to $DBversion done (Bug 28772 - Store hashed API key secrets)\n"; |
20874 |
SetVersion ($DBversion); |
20875 |
} |
20876 |
|
20846 |
# SEE bug 13068 |
20877 |
# SEE bug 13068 |
20847 |
# if there is anything in the atomicupdate, read and execute it. |
20878 |
# if there is anything in the atomicupdate, read and execute it. |
20848 |
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; |
20879 |
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; |
20849 |
- |
|
|