summaryrefslogtreecommitdiffstats
path: root/settings/templates
diff options
context:
space:
mode:
authorGreta Doci <gretadoci@gmail.com>2019-05-17 13:00:08 +0200
committerGreta Doci <gretadoci@gmail.com>2019-05-28 17:17:04 +0200
commit536b4106bb9d48caf8a94becd94483ab57c73299 (patch)
tree1b4f5564e45ba4f2560f5e689080bd35fce6bf30 /settings/templates
parent74ad4cce838172a51d441ffd53b7cae936f9dbb3 (diff)
downloadnextcloud-server-536b4106bb9d48caf8a94becd94483ab57c73299.tar.gz
nextcloud-server-536b4106bb9d48caf8a94becd94483ab57c73299.zip
Fix 2fa icons in dark theme, fix #13643
Signed-off-by: Greta Doci <gretadoci@gmail.com>
Diffstat (limited to 'settings/templates')
-rw-r--r--settings/templates/settings/personal/security.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/settings/templates/settings/personal/security.php b/settings/templates/settings/personal/security.php
index b7983b7c5d9..6cd8ae735be 100644
--- a/settings/templates/settings/personal/security.php
+++ b/settings/templates/settings/personal/security.php
@@ -69,12 +69,26 @@ if($_['passwordChangeSupported']) {
<?php foreach ($_['twoFactorProviderData']['providers'] as $data) { ?>
<li>
<?php
+
/** @var \OCP\Authentication\TwoFactorAuth\IProvidesPersonalSettings $provider */
$provider = $data['provider'];
+ //Handle 2FA provider icons and theme
if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
- $icon = $provider->getDarkIcon();
+ if ($_['themedark']) {
+ $icon = $provider->getLightIcon();
+ }
+ else {
+ $icon = $provider->getDarkIcon();
+ }
+ //fallback icon if the 2factor provider doesn't provide an icon.
} else {
- $icon = image_path('core', 'actions/password.svg');
+ if ($_['themedark']) {
+ $icon = image_path('core', 'actions/password-white.svg');
+ }
+ else {
+ $icon = image_path('core', 'actions/password.svg');
+ }
+
}
/** @var \OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings $settings */
$settings = $data['settings'];