Page MenuHomePhorge

D5334.1775369884.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D5334.1775369884.diff

diff --git a/plugins/kolab/Kolab/Configuration.php b/plugins/kolab/Kolab/Configuration.php
--- a/plugins/kolab/Kolab/Configuration.php
+++ b/plugins/kolab/Kolab/Configuration.php
@@ -15,13 +15,23 @@
$this->plugin->add_hook('startup', [$this, 'startupHook']);
}
- /**
- * Startup hook handler
- */
- public function startupHook($args): array
+ private function applyConfigurationOverlays($overlays)
{
- $config = Client::getMyConfig();
+ $overlaySettings = $this->rc->config->get('configuration-overlays');
+ if (!$overlaySettings) {
+ \rcube::raise_error("Can't find configuration overlay", true);
+ return;
+ }
+ foreach ($overlays as $overlay) {
+ if (!array_key_exists($overlay, $overlaySettings)) {
+ \rcube::raise_error("Can't find configuration overlay $overlay", true);
+ }
+ $this->applyConfiguration($overlaySettings[$overlay]);
+ }
+ }
+ private function applyConfiguration($config)
+ {
foreach ($config as $key => $value) {
$mode = null;
if (preg_match('/^merge:/', $key)) {
@@ -30,6 +40,9 @@
}
switch ($key) {
+ case 'kolab-configuration-overlays':
+ $this->applyConfigurationOverlays($value);
+ continue 2;
case 'plugins':
foreach ($value as $plugin) {
// Note that kolab_2fa plugin does not work when kolab_auth plugin is disabled,
@@ -57,14 +70,21 @@
$this->rc->config->set($key, $value);
}
+ }
+ }
- switch ($key) {
- case 'skin':
- if ($this->rc->output->type == 'html') {
- $this->rc->output->set_skin($value);
- $this->rc->output->set_env('skin', $value);
- }
- break;
+ /**
+ * Startup hook handler
+ */
+ public function startupHook($args): array
+ {
+ $config = Client::getMyConfig();
+ $this->applyConfiguration($config);
+
+ if ($skin = $config['skin'] ?? false) {
+ if ($this->rc->output->type == 'html') {
+ $this->rc->output->set_skin($skin);
+ $this->rc->output->set_env('skin', $skin);
}
}

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 5, 6:18 AM (6 h, 27 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18832427
Default Alt Text
D5334.1775369884.diff (2 KB)

Event Timeline