From 029c2fa60eec5927b694ce92ab2779ffd2998cc4 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 21 May 2009 16:40:10 -0400
Subject: [PATCH] Pass return value of config->load_from_file() back to the plugin

---
 program/include/rcube_plugin.php |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/program/include/rcube_plugin.php b/program/include/rcube_plugin.php
index 63acaf8..f7820c4 100644
--- a/program/include/rcube_plugin.php
+++ b/program/include/rcube_plugin.php
@@ -53,13 +53,18 @@
    * The loaded values are patched over the global configuration.
    *
    * @param string Config file name relative to the plugin's folder
+   * @return boolean True on success, false on failure
    */
   public function load_config($fname = 'config.inc.php')
   {
     $fpath = $this->home.'/'.$fname;
     $rcmail = rcmail::get_instance();
-    if (!$rcmail->config->load_from_file($fpath))
+    if (!$rcmail->config->load_from_file($fpath)) {
       raise_error(array('code' => 527, 'type' => 'php', 'message' => "Failed to load config from $fpath"), true, false);
+      return false;
+    }
+    
+    return true;
   }
 
   /**

--
Gitblit v1.9.1