Migrate personal settings to new API
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Родитель
eefdde8e86
Коммит
d2342f0b85
|
@ -24,7 +24,7 @@ use OCP\IL10N;
|
|||
use OCP\IUser;
|
||||
use OCP\Template;
|
||||
|
||||
class U2FProvider implements IProvider, IProvidesIcons {
|
||||
class U2FProvider implements IProvider, IProvidesIcons, IProvidesPersonalSettings {
|
||||
|
||||
/** @var IL10N */
|
||||
private $l10n;
|
||||
|
@ -83,11 +83,6 @@ class U2FProvider implements IProvider, IProvidesIcons {
|
|||
return count($this->manager->getDevices($user)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param IUser $user
|
||||
*
|
||||
* @return IPersonalProviderSettings
|
||||
*/
|
||||
public function getPersonalSettings(IUser $user): IPersonalProviderSettings {
|
||||
return new Personal();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types = 1);
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
|
||||
|
@ -23,27 +23,12 @@ declare(strict_types = 1);
|
|||
|
||||
namespace OCA\TwoFactorU2F\Settings;
|
||||
|
||||
use OCP\AppFramework\Http\TemplateResponse;
|
||||
use OCP\Settings\ISettings;
|
||||
use OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings;
|
||||
use OCP\Template;
|
||||
|
||||
class Personal implements ISettings {
|
||||
class Personal implements IPersonalProviderSettings {
|
||||
|
||||
/**
|
||||
* @return TemplateResponse
|
||||
*/
|
||||
public function getForm(): TemplateResponse {
|
||||
return new TemplateResponse('twofactor_u2f', 'personal');
|
||||
public function getBody(): Template {
|
||||
return new Template('twofactor_u2f', 'personal');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string the section ID
|
||||
*/
|
||||
public function getSection(): string {
|
||||
return 'security';
|
||||
}
|
||||
|
||||
public function getPriority(): int {
|
||||
return 40;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче