From dc2122b437cae74a523b84503cecf20482585a1f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 28 Jul 2021 20:49:55 +0200 Subject: [PATCH] Bug 28786: Add new syspref TwoFactorAuthentication Sponsored-by: Orex Digital Signed-off-by: David Nind Signed-off-by: Marcel de Rooy --- installer/data/mysql/atomicupdate/two-fa.perl | 10 ++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/modules/admin/preferences/staff_interface.pref | 6 ++++++ 3 files changed, 17 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/two-fa.perl diff --git a/installer/data/mysql/atomicupdate/two-fa.perl b/installer/data/mysql/atomicupdate/two-fa.perl new file mode 100644 index 00000000000..25896b62016 --- /dev/null +++ b/installer/data/mysql/atomicupdate/two-fa.perl @@ -0,0 +1,10 @@ +$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') + }); + + NewVersion( $DBversion, 28786, "Add new syspref TwoFactorAuthentication"); +} diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index deaf6b6fc28..2a9b35aa10e 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -688,6 +688,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'), ('TranslateNotices','0',NULL, 'Allow notices to be translated','YesNo'), ('TrapHoldsOnOrder','1',NULL,'If enabled, Koha will trap holds for on order items ( notforloan < 0 )','YesNo'), +('TwoFactorAuthentication', '0', 'NULL', 'Enables two-factor authentication', 'YesNo'), ('UNIMARCAuthorityField100','afrey50 ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'), ('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'), ('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref index 10c41c581d4..027fa4176d0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref @@ -188,3 +188,9 @@ Staff interface: 1: "Don't allow" 0: Allow - staff to login by means other than shibboleth. + - + - pref: TwoFactorAuthentication + choices: + 1: Enable + 0: "Don't enable" + - two-factor authentication (2FA). -- 2.25.1