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

github.com/nextcloud/twofactor_u2f.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2017-11-27 19:41:49 +0300
committerGitHub <noreply@github.com>2017-11-27 19:41:49 +0300
commit360513fc90afbfc3d0282cac8f1fde73f7cb3fd8 (patch)
tree0d76d944ffd396aec090c4042f9a841685e4e4f8
parent6c19d400e3542d7661f720fe35656df0e5aedf5e (diff)
parentede5d0d88285f85d6b22578e1b49134515381714 (diff)
Merge pull request #72 from nextcloud/enhancent/settings-security-section
List U2F settings in security section
-rw-r--r--appinfo/app.php14
-rw-r--r--appinfo/info.xml3
-rw-r--r--lib/Settings/Personal.php50
-rw-r--r--settings/personal.php5
4 files changed, 53 insertions, 19 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
deleted file mode 100644
index baa7afb..0000000
--- a/appinfo/app.php
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-
-/**
- * Nextcloud - U2F 2FA
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @copyright Christoph Wurst 2016
- */
-
-OC_App::registerPersonal('twofactor_u2f', 'settings/personal');
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 023d7b7..ca1fe50 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -33,4 +33,7 @@
<provider>OCA\TwoFactorU2F\Activity\Provider</provider>
</providers>
</activity>
+ <settings>
+ <personal>OCA\TwoFactorU2F\Settings\Personal</personal>
+ </settings>
</info>
diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php
new file mode 100644
index 0000000..a1ecd6c
--- /dev/null
+++ b/lib/Settings/Personal.php
@@ -0,0 +1,50 @@
+<?php
+
+/**
+ * @author Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * Two-factor U2F
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+namespace OCA\TwoFactorU2F\Settings;
+
+use OCP\AppFramework\Http\TemplateResponse;
+use OCP\Settings\ISettings;
+
+class Personal implements ISettings {
+
+ /**
+ * @return TemplateResponse
+ */
+ public function getForm() {
+ return new TemplateResponse('twofactor_u2f', 'personal');
+ }
+
+ /**
+ * @return string the section ID
+ */
+ public function getSection() {
+ return 'security';
+ }
+
+ /**
+ * @return int
+ */
+ public function getPriority() {
+ return 40;
+ }
+
+}
diff --git a/settings/personal.php b/settings/personal.php
deleted file mode 100644
index 4ccf86b..0000000
--- a/settings/personal.php
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-
-$tmpl = new \OCP\Template('twofactor_u2f', 'personal');
-
-return $tmpl->fetchPage();