aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Settings
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-01-10 16:04:13 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-02-28 11:55:58 +0100
commitc621da4fd682990af1520e0313dd763c621b041f (patch)
treed4083b957f4f5102f31780edf521e0d67512f9f7 /lib/private/Settings
parent4af583e23f922824e8e9ad2bf6347e6a1f163d8f (diff)
downloadnextcloud-server-c621da4fd682990af1520e0313dd763c621b041f.tar.gz
nextcloud-server-c621da4fd682990af1520e0313dd763c621b041f.zip
Do not load 2fa admin settings async
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Settings')
-rw-r--r--lib/private/Settings/Admin/Security.php26
1 files changed, 21 insertions, 5 deletions
diff --git a/lib/private/Settings/Admin/Security.php b/lib/private/Settings/Admin/Security.php
index dd80d4d3ae6..21e18883cc0 100644
--- a/lib/private/Settings/Admin/Security.php
+++ b/lib/private/Settings/Admin/Security.php
@@ -25,25 +25,35 @@
namespace OC\Settings\Admin;
+use OC\Authentication\TwoFactorAuth\MandatoryTwoFactor;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Encryption\IManager;
+use OCP\IInitialStateService;
use OCP\IUserManager;
use OCP\Settings\ISettings;
class Security implements ISettings {
+
/** @var IManager */
private $manager;
/** @var IUserManager */
private $userManager;
- /**
- * @param IManager $manager
- * @param IUserManager $userManager
- */
- public function __construct(IManager $manager, IUserManager $userManager) {
+ /** @var MandatoryTwoFactor */
+ private $mandatoryTwoFactor;
+
+ /** @var IInitialStateService */
+ private $initialState;
+
+ public function __construct(IManager $manager,
+ IUserManager $userManager,
+ MandatoryTwoFactor $mandatoryTwoFactor,
+ IInitialStateService $initialState) {
$this->manager = $manager;
$this->userManager = $userManager;
+ $this->mandatoryTwoFactor = $mandatoryTwoFactor;
+ $this->initialState = $initialState;
}
/**
@@ -61,6 +71,12 @@ class Security implements ISettings {
}
}
+ $this->initialState->provideInitialState(
+ 'settings',
+ 'mandatory2FAState',
+ $this->mandatoryTwoFactor->getState()
+ );
+
$parameters = [
// Encryption API
'encryptionEnabled' => $this->manager->isEnabled(),