Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2018-10-01 23:20:57 +02:00
Родитель 195f36de5e
Коммит 5a813aa8eb
4 изменённых файлов: 44 добавлений и 31 удалений

Просмотреть файл

@ -8,11 +8,6 @@
* @copyright Christoph Wurst 2016
*/
#body-login .wrapper .warning img {
width: 100px;
margin-left: 80px;
}
.u2f-loading {
display: inline-block;
vertical-align: sub;

Просмотреть файл

@ -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');;
}
}

Просмотреть файл

@ -11,9 +11,9 @@ style('twofactor_u2f', 'style');
<input id="challenge" type="hidden" name="challenge">
</form>
<img src="<?php print_unescaped(image_path('twofactor_u2f', 'app.svg')); ?>">
<img class="two-factor-icon" src="<?php print_unescaped(image_path('twofactor_u2f', 'app.svg')); ?>" alt="">
<p id="u2f-info">
<?php p($l->t('Please plug in your U2F device and press the device button to authorize.')) ?>
<?php p($l->t('Plug in your U2F device and press the device button to authorize.')) ?>
</p>
<p id="u2f-error"
style="display: none">
@ -21,7 +21,7 @@ style('twofactor_u2f', 'style');
</p>
<p>
<em>
<?php p($l->t('Install the "U2F Support Add-on" on Firefox to use U2F, this is not needed on Chrome.')) ?>
<?php p($l->t('In Firefox, you need to install the "U2F Support Add-on" to use U2F. This is not needed in Chrome.')) ?>
<p id="u2f-http-warning"
style="display: none">
<?php p($l->t('You are accessing this site via an insecure connection. Browsers might therefore refuse the U2F authentication.')) ?>

Просмотреть файл

@ -3,25 +3,23 @@ script('twofactor_u2f', 'build/settings');
style('twofactor_u2f', 'style');
?>
<div class="section">
<h2 data-anchor-name="u2f-second-factor-auth"><?php p($l->t('U2F second-factor auth')); ?></h2>
<div id="twofactor-u2f-settings">
<span class="icon-loading-small u2f-loading"></span>
<span><?php p($l->t('Loading your devices …')); ?></span>
</div>
<p class="utf-register-info" style="display: none;">
<?php p($l->t('Please plug in your U2F device and press the device button to authorize.')) ?>
</p>
<p class="utf-register-info" style="display: none;">
<em>
<?php p($l->t('Chrome is the only browser that supports U2F devices. You need to install the "U2F Support Add-on" on Firefox to use U2F.')) ?>
<p id="u2f-http-warning"
style="display: none">
<?php p($l->t('You are accessing this site via an insecure connection. Browsers might therefore refuse the U2F authentication.')) ?>
</p>
</em>
</p>
<p class="utf-register-success" style="display: none;">
<span class="icon-checkmark-color" style="width: 16px;"></span><?php p($l->t('U2F device successfully registered.')) ?>
</p>
<div id="twofactor-u2f-settings">
<span class="icon-loading-small u2f-loading"></span>
<span><?php p($l->t('Loading your devices …')); ?></span>
</div>
<p class="utf-register-info" style="display: none;">
<?php p($l->t('Please plug in your U2F device and press the device button to authorize.')) ?>
</p>
<p class="utf-register-info" style="display: none;">
<em>
<?php p($l->t('Chrome is the only browser that supports U2F devices. You need to install the "U2F Support Add-on" on Firefox to use U2F.')) ?>
<p id="u2f-http-warning"
style="display: none">
<?php p($l->t('You are accessing this site via an insecure connection. Browsers might therefore refuse the U2F authentication.')) ?>
</p>
</em>
</p>
<p class="utf-register-success" style="display: none;">
<span class="icon-checkmark-color"
style="width: 16px;"></span><?php p($l->t('U2F device successfully registered.')) ?>
</p>