Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117892570
D5334.1775365745.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D5334.1775365745.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 5, 5:09 AM (4 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18832427
Default Alt Text
D5334.1775365745.diff (2 KB)
Attached To
Mode
D5334: Kolab plugin: configuration overlays
Attached
Detach File
Event Timeline