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

github.com/nextcloud/twofactor_gateway.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-03-07 19:00:52 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-03-07 19:00:52 +0300
commitfe47092d6b07de6c49ae9e4ba681b86b86ba72b0 (patch)
tree8059cbba9706bc72c053022e8dd2b9555a88bc84 /lib/Settings
parent3833321cd616cde48829f240d9697056ba2107ef (diff)
Migrate personal settings to Nextcloud 15 provider settings API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Settings')
-rw-r--r--lib/Settings/PersonalSettings.php53
1 files changed, 23 insertions, 30 deletions
diff --git a/lib/Settings/PersonalSettings.php b/lib/Settings/PersonalSettings.php
index 5db32e8..5cd488e 100644
--- a/lib/Settings/PersonalSettings.php
+++ b/lib/Settings/PersonalSettings.php
@@ -1,6 +1,6 @@
<?php
-declare (strict_types = 1);
+declare (strict_types=1);
/**
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
@@ -23,34 +23,27 @@ declare (strict_types = 1);
namespace OCA\TwoFactorGateway\Settings;
-use OCP\AppFramework\Http\TemplateResponse;
-use OCP\Settings\ISettings;
-
-class PersonalSettings implements ISettings
-{
-
- /**
- * @return TemplateResponse
- */
- public function getForm()
- {
- return new TemplateResponse('twofactor_gateway', 'personal_settings');
- }
-
- /**
- * @return string
- */
- public function getSection()
- {
- return 'security';
- }
-
- /**
- * @return int
- */
- public function getPriority()
- {
- return 50;
- }
+use OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings;
+use OCP\Template;
+
+class PersonalSettings implements IPersonalProviderSettings {
+
+ /** @var string */
+ private $gateway;
+
+ public function __construct(string $gateway) {
+ $this->gateway = $gateway;
+ }
+
+ /**
+ * @return Template
+ *
+ * @since 15.0.0
+ */
+ public function getBody(): Template {
+ $tmpl = new Template('twofactor_gateway', 'personal_settings');
+ $tmpl->assign('gateway', $this->gateway);
+ return $tmpl;
+ }
}