From 458767fb1b65a15ddae3846df6aacdc9610342ad Mon Sep 17 00:00:00 2001
From: jwarnier <jwarnier@ispconfig3>
Date: Thu, 23 Sep 2010 17:15:39 -0400
Subject: [PATCH] - replace double-quotes with single-quotes whenever appropriate - reword some output - fix typos

---
 server/lib/classes/getconf.inc.php |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/server/lib/classes/getconf.inc.php b/server/lib/classes/getconf.inc.php
index fd0c088..2a31978 100644
--- a/server/lib/classes/getconf.inc.php
+++ b/server/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,
@@ -38,8 +38,8 @@
 		if(!is_array($this->config[$server_id])) {
 			$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"]));
+			$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']));
 		}
 		
 		if($section == '') {
@@ -49,12 +49,17 @@
 		}
 	}
 	
-	function get_global_config() {
+	public function get_global_config($section = '') {
+		global $app;
 		
-		die("not yet implemented");
-		
+		if(!is_array($this->config['global'])) {
+			$app->uses('ini_parser');
+			$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']));
+		}
+		return ($section == '') ? $this->config['global'] : $this->config['global'][$section];
 	}
 	
 }
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1