From: Tim Düsterhus Date: Tue, 26 Jan 2021 14:58:25 +0000 (+0100) Subject: Enforce the multi-factor requirement in ACP X-Git-Tag: 5.4.0_Alpha_1~353^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=32ae59b2cb15d672942d50e69ae5eb4e47cc3183;p=GitHub%2FWoltLab%2FWCF.git Enforce the multi-factor requirement in ACP --- diff --git a/wcfsetup/install/files/lib/system/WCFACP.class.php b/wcfsetup/install/files/lib/system/WCFACP.class.php index 8bfd76bbb6..2ab1a294e2 100644 --- a/wcfsetup/install/files/lib/system/WCFACP.class.php +++ b/wcfsetup/install/files/lib/system/WCFACP.class.php @@ -17,6 +17,7 @@ use wcf\system\request\RouteHandler; use wcf\system\session\ACPSessionFactory; use wcf\system\session\SessionHandler; use wcf\system\template\ACPTemplateEngine; +use wcf\system\user\multifactor\TMultifactorRequirementEnforcer; use wcf\util\FileUtil; use wcf\util\HeaderUtil; @@ -200,6 +201,16 @@ class WCFACP extends WCF exit; } + // The autoloader is not available during the definition of `WCFACP`, + // thus we are unable to use the trait directly. + // + // Workaround this issue by using an anonymous class. + (new class { + use TMultifactorRequirementEnforcer { + enforceMultifactorAuthentication as public enforce; + } + })->enforce(); + // force debug mode if in ACP and authenticated self::$overrideDebugMode = true; }