Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-05-19 20:09:12 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-05-20 14:27:55 +0300
commit9d5a542a4e1b70ea9c1a094552bca1a637289e91 (patch)
treea0b282d0b635cb75e4db443c8823b056b0d7b5a2 /apps/settings/lib
parenteb720b9726aebc20ab0ed19e39ebf9c1c01ec80e (diff)
Improve two factor admin settings
- Port more of it to vue - Use new nextcloud vue components for the setting section - Add a bit of spacing between the elements Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/settings/lib')
-rw-r--r--apps/settings/lib/Settings/Admin/Security.php27
1 files changed, 14 insertions, 13 deletions
diff --git a/apps/settings/lib/Settings/Admin/Security.php b/apps/settings/lib/Settings/Admin/Security.php
index 2580c0a3d00..f84ef03b61b 100644
--- a/apps/settings/lib/Settings/Admin/Security.php
+++ b/apps/settings/lib/Settings/Admin/Security.php
@@ -31,30 +31,26 @@ use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\Encryption\IManager;
use OCP\IUserManager;
+use OCP\IURLGenerator;
use OCP\Settings\ISettings;
class Security implements ISettings {
-
- /** @var IManager */
- private $manager;
-
- /** @var IUserManager */
- private $userManager;
-
- /** @var MandatoryTwoFactor */
- private $mandatoryTwoFactor;
-
- /** @var IInitialState */
- private $initialState;
+ private IManager $manager;
+ private IUserManager $userManager;
+ private MandatoryTwoFactor $mandatoryTwoFactor;
+ private IInitialState $initialState;
+ private IURLGenerator $urlGenerator;
public function __construct(IManager $manager,
IUserManager $userManager,
MandatoryTwoFactor $mandatoryTwoFactor,
- IInitialState $initialState) {
+ IInitialState $initialState,
+ IURLGenerator $urlGenerator) {
$this->manager = $manager;
$this->userManager = $userManager;
$this->mandatoryTwoFactor = $mandatoryTwoFactor;
$this->initialState = $initialState;
+ $this->urlGenerator = $urlGenerator;
}
/**
@@ -77,6 +73,11 @@ class Security implements ISettings {
$this->mandatoryTwoFactor->getState()
);
+ $this->initialState->provideInitialState(
+ 'two-factor-admin-doc',
+ $this->urlGenerator->linkToDocs('admin-2fa')
+ );
+
$parameters = [
// Encryption API
'encryptionEnabled' => $this->manager->isEnabled(),