From aa78fde6a92f66b84d626e114d8b54a5fb6ece0c Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Wed, 14 Nov 2012 07:19:43 -0500
Subject: [PATCH] - Added function for IPv6 prefixes in multiserver mirror setups to nginx plugin.

---
 interface/lib/classes/getconf.inc.php |   41 ++++++++++++++++++++---------------------
 1 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/interface/lib/classes/getconf.inc.php b/interface/lib/classes/getconf.inc.php
index fd0c088..ad2a302 100644
--- a/interface/lib/classes/getconf.inc.php
+++ b/interface/lib/classes/getconf.inc.php
@@ -1,7 +1,7 @@
 <?php
 
 /*
-Copyright (c) 2006, Till Brehm, projektfarm Gmbh
+Copyright (c) 2007, Till Brehm, projektfarm Gmbh
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without modification,
@@ -30,31 +30,30 @@
 
 class getconf {
 
-	var $config;
+	private $config;
 	
-	function get_server_config($server_id, $section = '') {
+	public function get_server_config($server_id, $section = '') {
+		global $app;
+
+		if(!isset($this->config[$server_id])) {
+			$app->uses('ini_parser');
+			$server_id = $app->functions->intval($server_id);
+			$server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = '.$server_id);
+			$this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server['config']));
+		}
+		return ($section == '') ? $this->config[$server_id] : $this->config[$server_id][$section];
+	}
+	
+	public function get_global_config($section = '') {
 		global $app;
 		
-		if(!is_array($this->config[$server_id])) {
+		if(!isset($this->config['global'])) {
 			$app->uses('ini_parser');
-			$server_id = intval($server_id);
-			$server = $app->db->queryOneRecord("SELECT config FROM server WHERE server_id = $server_id");
-			$this->config[$server_id] = $app->ini_parser->parse_ini_string(stripslashes($server["config"]));
+			$tmp = $app->db->queryOneRecord('SELECT config FROM sys_ini WHERE sysini_id = 1');
+			$this->config['global'] = $app->ini_parser->parse_ini_string(stripslashes($tmp['config']));
 		}
-		
-		if($section == '') {
-			return $this->config[$server_id];
-		} else {
-			return $this->config[$server_id][$section];
-		}
+		return ($section == '') ? $this->config['global'] : $this->config['global'][$section];
 	}
-	
-	function get_global_config() {
-		
-		die("not yet implemented");
-		
-	}
-	
 }
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1