Author:   Lars Michelsen <[email protected]>
Date:     Sat Feb 26 14:24:52 2011 +0100
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Sat Feb 26 13:24:52 2011 +0000

Bugfix: Fixed section merging in main config when using more than one config 
file

---

 ChangeLog                                   |    1 +
 share/server/core/classes/GlobalMainCfg.php |   18 ++++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cd461d4..ab5bf1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@ Core
   * Bugfix: The installer overwrites the default iconset files on upgrade as 
expected
   * Added mechanism to search userfiles in independent structures. This allows
        usage of the local/ structure in OMD
+  * Bugfix: Fixed section merging in main config when using more than one 
config file
 
 Automap
   * Made automap coord parsing regex resistent against html entities in the URL
diff --git a/share/server/core/classes/GlobalMainCfg.php 
b/share/server/core/classes/GlobalMainCfg.php
index 84fde1a..be567a8 100644
--- a/share/server/core/classes/GlobalMainCfg.php
+++ b/share/server/core/classes/GlobalMainCfg.php
@@ -1157,14 +1157,16 @@ class GlobalMainCfg {
                                        $sec = strtolower(trim(substr($line, 1, 
strlen($line)-2)));
                                        
                                        // write to array
-                                       if(preg_match('/^backend_/i', $sec)) {
-                                               $this->config[$sec] = Array();
-                                               
$this->config[$sec]['backendid'] = str_replace('backend_','',$sec);
-                                       } elseif(preg_match('/^rotation_/i', 
$sec)) {
-                                               $this->config[$sec] = Array();
-                                               
$this->config[$sec]['rotationid'] = str_replace('rotation_','',$sec);
-                                       } else {
-                                               $this->config[$sec] = Array();
+                                       if(!isset($this->config[$sec])) {
+                                               if(preg_match('/^backend_/i', 
$sec)) {
+                                                       $this->config[$sec] = 
Array();
+                                                       
$this->config[$sec]['backendid'] = str_replace('backend_','',$sec);
+                                               } 
elseif(preg_match('/^rotation_/i', $sec)) {
+                                                       $this->config[$sec] = 
Array();
+                                                       
$this->config[$sec]['rotationid'] = str_replace('rotation_','',$sec);
+                                               } else {
+                                                       $this->config[$sec] = 
Array();
+                                               }
                                        }
                                } else {
                                        // parameter...


------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to