From d073a66db3abf13a769ffaab50028bac4e771916 Mon Sep 17 00:00:00 2001 From: Takika Date: Tue, 7 Jan 2014 14:32:33 +0100 Subject: Load plugin config file from any configured path Try to load plugin_name.inc.php config file from any pre-configured config path (rcube_config::path array) so webmail admins can move plugin configurations out of www root. --- program/lib/Roundcube/rcube_plugin.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'program/lib/Roundcube') diff --git a/program/lib/Roundcube/rcube_plugin.php b/program/lib/Roundcube/rcube_plugin.php index aa6d8376e..a571609f1 100644 --- a/program/lib/Roundcube/rcube_plugin.php +++ b/program/lib/Roundcube/rcube_plugin.php @@ -131,6 +131,16 @@ abstract class rcube_plugin 'file' => __FILE__, 'line' => __LINE__, 'message' => "Failed to load config from $fpath"), true, false); return false; + } else { + $fname = $this->ID . '.inc.php'; + // Search plugin_name.inc.php file in any configured path + if (!$rcube->config->load_from_file($fname)) { + rcube::raise_error(array( + 'code' => 527, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Failed to load $fname config file from any configured path"), true, false); + return false; + } } return true; -- cgit v1.2.3