summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-03-27 16:32:51 +0100
committerAleksander Machniak <alec@alec.pl>2013-03-27 17:02:55 +0100
commit395b74051ce974ced8a5abe378f66e9bcf0c8e34 (patch)
tree2d438a7c9e7767759ebffe70530683240fb53232 /program/include
parent268a28efb25193e5f48e7ba8e41f0bca8306c34e (diff)
Whitelist configuration options (user preferences) that can be changed using save-pref command
Conflicts: program/lib/Roundcube/rcube_plugin.php program/lib/Roundcube/rcube_plugin_api.php Conflicts: CHANGELOG program/steps/utils/save_pref.inc
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_plugin.php8
-rw-r--r--program/include/rcube_plugin_api.php4
2 files changed, 12 insertions, 0 deletions
diff --git a/program/include/rcube_plugin.php b/program/include/rcube_plugin.php
index 49bec043c..550c8420b 100644
--- a/program/include/rcube_plugin.php
+++ b/program/include/rcube_plugin.php
@@ -61,6 +61,14 @@ abstract class rcube_plugin
*/
public $noframe = false;
+ /**
+ * A list of config option names that can be modified
+ * by the user via user interface (with save-pref command)
+ *
+ * @var array
+ */
+ public $allowed_prefs;
+
protected $home;
protected $urlbase;
private $mytask;
diff --git a/program/include/rcube_plugin_api.php b/program/include/rcube_plugin_api.php
index 4846cd91b..f9e067fdf 100644
--- a/program/include/rcube_plugin_api.php
+++ b/program/include/rcube_plugin_api.php
@@ -32,6 +32,7 @@ class rcube_plugin_api
public $url = 'plugins/';
public $output;
public $config;
+ public $allowed_prefs = array();
public $handlers = array();
private $plugins = array();
@@ -182,6 +183,9 @@ class rcube_plugin_api
$plugin->init();
$this->plugins[$plugin_name] = $plugin;
}
+ if (!empty($plugin->allowed_prefs)) {
+ $this->allowed_prefs = array_merge($this->allowed_prefs, $plugin->allowed_prefs);
+ }
return true;
}
}