From 39dd4ecc8b4a2b3b98a7ffe7056ae64240b22d56 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sun, 11 May 2014 17:39:37 -0400
Subject: [PATCH] - Added functions client_get_emailcontact and client_login_get to remote api. - Add option to _get functions of the remote-api to return all records when primaryID = -1 - Fixed permission problem in _get functions of remote api. - Fixed typo in german dashboard language file.
---
interface/lib/classes/getconf.inc.php | 44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/interface/lib/classes/getconf.inc.php b/interface/lib/classes/getconf.inc.php
index fd0c088..45fefa6 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,31 @@
class getconf {
- var $config;
-
- function get_server_config($server_id, $section = '') {
+ private $config;
+
+ public function get_server_config($server_id, $section = '') {
global $app;
-
- if(!is_array($this->config[$server_id])) {
+
+ if(!isset($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_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']));
}
-
- if($section == '') {
- return $this->config[$server_id];
- } else {
- return $this->config[$server_id][$section];
+ return ($section == '') ? $this->config[$server_id] : $this->config[$server_id][$section];
+ }
+
+ public function get_global_config($section = '') {
+ global $app;
+
+ if(!isset($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];
}
-
- function get_global_config() {
-
- die("not yet implemented");
-
- }
-
+
}
-?>
\ No newline at end of file
+?>
--
Gitblit v1.9.1