From f96b8856950b68cfa1a2251d926b06eb1d25762c Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Mon, 25 Jul 2022 15:34:47 +0200
Subject: [PATCH] Bug 30588: Add 'enforced' option to TwoFactorAuthentication

Sponsored-by: Rijksmuseum, Netherlands
---
 installer/data/mysql/mandatory/sysprefs.sql                | 2 +-
 .../prog/en/modules/admin/preferences/staff_interface.pref | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql
index 227049afe5c..e99bb058b01 100644
--- a/installer/data/mysql/mandatory/sysprefs.sql
+++ b/installer/data/mysql/mandatory/sysprefs.sql
@@ -718,7 +718,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'),
+('TwoFactorAuthentication', 'disable', 'enforce|enabled|disabled', 'Enables two-factor authentication', 'Choice'),
 ('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 32473520c4f..29c51d8d160 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
@@ -209,6 +209,7 @@ Staff interface:
         -
             - pref: TwoFactorAuthentication
               choices:
-                  1: Enable
-                  0: "Don't enable"
-            - two-factor authentication (2FA).
+                  "enforce": Enforce
+                  "enable": Enable
+                  "disable": "Don't enable"
+            - two-factor authentication (2FA) for staff members.
-- 
2.25.1