Bugzilla – Attachment 128842 Details for
Bug 28786
Two-factor authentication for staff client - TOTP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28786: (QA follow-up) Upgrade atomicupdate to new style
Bug-28786-QA-follow-up-Upgrade-atomicupdate-to-new.patch (text/plain), 4.06 KB, created by
Marcel de Rooy
on 2021-12-21 15:12:42 UTC
(
hide
)
Description:
Bug 28786: (QA follow-up) Upgrade atomicupdate to new style
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-12-21 15:12:42 UTC
Size:
4.06 KB
patch
obsolete
>From c13423bc7aefa49443bdcbc0af083ef438f319e2 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 21 Dec 2021 15:07:56 +0000 >Subject: [PATCH] Bug 28786: (QA follow-up) Upgrade atomicupdate to new style >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run dbrev again. >--- > installer/data/mysql/atomicupdate/two-fa.perl | 34 ---------------- > installer/data/mysql/atomicupdate/two-fa.pl | 39 +++++++++++++++++++ > 2 files changed, 39 insertions(+), 34 deletions(-) > delete mode 100644 installer/data/mysql/atomicupdate/two-fa.perl > create mode 100755 installer/data/mysql/atomicupdate/two-fa.pl > >diff --git a/installer/data/mysql/atomicupdate/two-fa.perl b/installer/data/mysql/atomicupdate/two-fa.perl >deleted file mode 100644 >index f11c0d0684..0000000000 >--- a/installer/data/mysql/atomicupdate/two-fa.perl >+++ /dev/null >@@ -1,34 +0,0 @@ >-$DBversion = 'XXX'; # will be replaced by the RM >-if( CheckVersion( $DBversion ) ) { >- >- $dbh->do(q{ >- INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >- ('TwoFactorAuthentication', '0', 'NULL', 'Enables two-factor authentication', 'YesNo') >- }); >- >- if( !column_exists( 'borrowers', 'secret' ) ) { >- $dbh->do(q{ >- ALTER TABLE borrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password` >- }); >- } >- >- if( !column_exists( 'deletedborrowers', 'secret' ) ) { >- $dbh->do(q{ >- ALTER TABLE deletedborrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password` >- }); >- } >- >- if( !column_exists( 'borrowers', 'auth_method' ) ) { >- $dbh->do(q{ >- ALTER TABLE borrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret` >- }); >- } >- >- if( !column_exists( 'deletedborrowers', 'auth_method' ) ) { >- $dbh->do(q{ >- ALTER TABLE deletedborrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret` >- }); >- } >- >- NewVersion( $DBversion, 28786, "Add new syspref TwoFactorAuthentication"); >-} >diff --git a/installer/data/mysql/atomicupdate/two-fa.pl b/installer/data/mysql/atomicupdate/two-fa.pl >new file mode 100755 >index 0000000000..06fd394694 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/two-fa.pl >@@ -0,0 +1,39 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => 28786, >+ description => "Add syspref TwoFactorAuthentication, fields secret and auth_method", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('TwoFactorAuthentication', '0', 'NULL', 'Enables two-factor authentication', 'YesNo') >+ }); >+ >+ if( !column_exists( 'borrowers', 'secret' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE borrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password` >+ }); >+ } >+ >+ if( !column_exists( 'deletedborrowers', 'secret' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE deletedborrowers ADD COLUMN `secret` MEDIUMTEXT COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA' AFTER `password` >+ }); >+ } >+ >+ if( !column_exists( 'borrowers', 'auth_method' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE borrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret` >+ }); >+ } >+ >+ if( !column_exists( 'deletedborrowers', 'auth_method' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE deletedborrowers ADD COLUMN `auth_method` ENUM('password', 'two-factor') NOT NULL DEFAULT 'password' COMMENT 'Authentication method' AFTER `secret` >+ }); >+ } >+ }, >+}; >-- >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 28786
:
123375
|
123376
|
123377
|
123378
|
123379
|
123380
|
123381
|
123397
|
123398
|
123399
|
123400
|
123401
|
123402
|
123403
|
124569
|
124770
|
124771
|
124844
|
124845
|
124846
|
124847
|
128841
|
128842
|
129383
|
129384
|
129474
|
129521
|
129557
|
129558
|
129559
|
129560
|
129561
|
129562
|
129563
|
129564
|
129565
|
129566
|
129567
|
129568
|
129569
|
129654
|
129655
|
129656
|
129657
|
129658
|
129659
|
129660
|
129661
|
129662
|
129665
|
131940
|
131941
|
131942
|
131943
|
131944
|
131945
|
131946
|
131947
|
131948
|
131949
|
131950
|
131951
|
131952
|
131953
|
131954
|
131955
|
131956
|
131957
|
131958
|
132142
|
132143
|
132144
|
132145
|
132146
|
132147
|
132148
|
132149
|
132150
|
132153
|
132154
|
132155
|
132156
|
132157
|
133222
|
133516
|
133522
|
133531
|
133533
|
133541
|
133548
|
133643
|
133686