diff options
Diffstat (limited to 'settings')
-rw-r--r-- | settings/css/settings.scss | 21 | ||||
-rw-r--r-- | settings/templates/settings/personal/security.php | 35 |
2 files changed, 56 insertions, 0 deletions
diff --git a/settings/css/settings.scss b/settings/css/settings.scss index ae1a456b699..48d7b555f09 100644 --- a/settings/css/settings.scss +++ b/settings/css/settings.scss @@ -471,6 +471,27 @@ table.nostyle { } } + + +/* Two-Factor Authentication (2FA) */ + +#two-factor-auth { + h3 { + margin-top: 24px; + } + + li > div { + margin-left: 20px; + } + + .two-factor-provider-settings-icon { + width: 16px; + height: 16px; + vertical-align: sub; + } +} + + #new-app-login-name, #new-app-password { width: 245px; diff --git a/settings/templates/settings/personal/security.php b/settings/templates/settings/personal/security.php index 6dd0e8d3cef..6b2c37b6a88 100644 --- a/settings/templates/settings/personal/security.php +++ b/settings/templates/settings/personal/security.php @@ -101,3 +101,38 @@ if($_['passwordChangeSupported']) { </div> </div> </div> + +<div id="two-factor-auth" class="section"> + <h2><?php p($l->t('Two-Factor Authentication'));?></h2> + <p class="settings-hint"> + <?php + if ($_['twoFactorProviderData']['enabled']) { + p($l->t('Two-factor authentication is enabled on your account.')); + } else { + p($l->t('Two-factor authentication is disabled on your account.')); + } + ?> + </p> + <ul> + <?php foreach ($_['twoFactorProviderData']['providers'] as $data) { ?> + <li> + <?php + /** @var \OCP\Authentication\TwoFactorAuth\IProvidesPersonalSettings $provider */ + $provider = $data['provider']; + if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) { + $icon = $provider->getDarkIcon(); + } else { + $icon = image_path('core', 'actions/password.svg'); + } + /** @var \OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings $settings */ + $settings = $data['settings']; + ?> + <h3> + <img class="two-factor-provider-settings-icon" src="<?php p($icon) ?>" alt=""> + <?php p($provider->getDisplayName()) ?> + </h3> + <?php print_unescaped($settings->getBody()->fetchPage()) ?> + </li> + <?php } ?> + </ul> +</div> |