aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/ThemingDefaults.php
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2022-10-19 17:13:15 +0200
committerGitHub <noreply@github.com>2022-10-19 17:13:15 +0200
commitbe892d2e283a0a939434650a0c9933308a2cc6bb (patch)
tree85f1ac03f25e55fec258749d67b35b6a2b97db83 /apps/theming/lib/ThemingDefaults.php
parentf116c8703982d6cd8407ca43f19e77b116041658 (diff)
parentd89da9b898ae25d7aadde7cf22063a487e7a8ace (diff)
downloadnextcloud-server-be892d2e283a0a939434650a0c9933308a2cc6bb.tar.gz
nextcloud-server-be892d2e283a0a939434650a0c9933308a2cc6bb.zip
Merge pull request #34576 from nextcloud/fix/user-theming-admin-overrride
Add admin user customization kill switch
Diffstat (limited to 'apps/theming/lib/ThemingDefaults.php')
-rw-r--r--apps/theming/lib/ThemingDefaults.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index 9d5183a6504..eee44e81fda 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -220,6 +220,10 @@ class ThemingDefaults extends \OC_Defaults {
// admin-defined primary color
$defaultColor = $this->getDefaultColorPrimary();
+
+ if ($this->isUserThemingDisabled()) {
+ return $defaultColor;
+ }
// user-defined primary color
$themingBackground = '';
@@ -494,4 +498,11 @@ class ThemingDefaults extends \OC_Defaults {
public function getTextColorPrimary() {
return $this->util->invertTextColor($this->getColorPrimary()) ? '#000000' : '#ffffff';
}
+
+ /**
+ * Has the admin disabled user customization
+ */
+ public function isUserThemingDisabled(): bool {
+ return $this->config->getAppValue('theming', 'disable-user-theming', 'no') === 'yes';
+ }
}