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
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-10-02 00:20:57 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2018-10-02 00:20:57 +0300
commit5a813aa8eba0b8ef0d9e3b464b0208e7e0d1eb13 (patch)
tree4007069158cc0e305f60483d1ef38eba0feaca63 /lib
parent195f36de5e2e5170b98f7f04d8c3e09d87dafa1e (diff)
Adapt to server changes
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/Provider/U2FProvider.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/Provider/U2FProvider.php b/lib/Provider/U2FProvider.php
index 9abe099..6ef45f2 100644
--- a/lib/Provider/U2FProvider.php
+++ b/lib/Provider/U2FProvider.php
@@ -1,6 +1,6 @@
<?php
-declare(strict_types = 1);
+declare(strict_types=1);
/**
* Nextcloud - U2F 2FA
@@ -15,12 +15,16 @@ declare(strict_types = 1);
namespace OCA\TwoFactorU2F\Provider;
use OCA\TwoFactorU2F\Service\U2FManager;
+use OCA\TwoFactorU2F\Settings\Personal;
+use OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings;
use OCP\Authentication\TwoFactorAuth\IProvider;
+use OCP\Authentication\TwoFactorAuth\IProvidesIcons;
+use OCP\Authentication\TwoFactorAuth\IProvidesPersonalSettings;
use OCP\IL10N;
use OCP\IUser;
use OCP\Template;
-class U2FProvider implements IProvider {
+class U2FProvider implements IProvider, IProvidesIcons {
/** @var IL10N */
private $l10n;
@@ -79,4 +83,20 @@ class U2FProvider implements IProvider {
return count($this->manager->getDevices($user)) > 0;
}
+ /**
+ * @param IUser $user
+ *
+ * @return IPersonalProviderSettings
+ */
+ public function getPersonalSettings(IUser $user): IPersonalProviderSettings {
+ return new Personal();
+ }
+
+ public function getLightIcon(): String {
+ return image_path('twofactor_u2f', 'app.svg');
+ }
+
+ public function getDarkIcon(): String {
+ return image_path('twofactor_u2f', 'app-dark.svg');;
+ }
}