Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
536b4106
Commit
536b4106
authored
5 years ago
by
Greta Doci
Browse files
Options
Downloads
Patches
Plain Diff
Fix 2fa icons in dark theme, fix #13643
Signed-off-by:
Greta Doci
<
gretadoci@gmail.com
>
parent
74ad4cce
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/Settings/Personal/Security.php
+8
-0
8 additions, 0 deletions
lib/private/Settings/Personal/Security.php
settings/templates/settings/personal/security.php
+16
-2
16 additions, 2 deletions
settings/templates/settings/personal/security.php
with
24 additions
and
2 deletions
lib/private/Settings/Personal/Security.php
+
8
−
0
View file @
536b4106
...
...
@@ -42,6 +42,7 @@ use OCP\IUserManager;
use
OCP\IUserSession
;
use
OCP\Session\Exceptions\SessionNotAvailableException
;
use
OCP\Settings\ISettings
;
use
OCP\IConfig
;
class
Security
implements
ISettings
{
...
...
@@ -69,6 +70,10 @@ class Security implements ISettings {
* @var string|null
*/
private
$uid
;
/**
*@var IConfig
*/
private
$config
;
public
function
__construct
(
IUserManager
$userManager
,
TwoFactorManager
$providerManager
,
...
...
@@ -76,6 +81,7 @@ class Security implements ISettings {
ProviderLoader
$providerLoader
,
IUserSession
$userSession
,
ISession
$session
,
IConfig
$config
,
IInitialStateService
$initialStateService
,
?string
$UserId
)
{
$this
->
userManager
=
$userManager
;
...
...
@@ -86,6 +92,7 @@ class Security implements ISettings {
$this
->
session
=
$session
;
$this
->
initialStateService
=
$initialStateService
;
$this
->
uid
=
$UserId
;
$this
->
config
=
$config
;
}
/**
...
...
@@ -108,6 +115,7 @@ class Security implements ISettings {
return
new
TemplateResponse
(
'settings'
,
'settings/personal/security'
,
[
'passwordChangeSupported'
=>
$passwordChangeSupported
,
'twoFactorProviderData'
=>
$this
->
getTwoFactorProviderData
(),
'themedark'
=>
$this
->
config
->
getUserValue
(
$this
->
uid
,
'accessibility'
,
'theme'
,
false
)
]);
}
...
...
This diff is collapsed.
Click to expand it.
settings/templates/settings/personal/security.php
+
16
−
2
View file @
536b4106
...
...
@@ -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'
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment