From afee192d2a77afa1c11d25156d0a44df94e19aed Mon Sep 17 00:00:00 2001 From: A. Täffner <darkalex@firesplash.de> Date: Sat, 23 Jan 2016 07:30:37 -0500 Subject: [PATCH] fixed the cronjob and noticed a bug in ISPC but not able to report as FlySpray is offline --- server/lib/classes/getconf.inc.php | 38 ++++++++++++++++++++++++++------------ 1 files changed, 26 insertions(+), 12 deletions(-) diff --git a/server/lib/classes/getconf.inc.php b/server/lib/classes/getconf.inc.php index fd0c088..2c20971 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, @@ -31,30 +31,44 @@ class getconf { var $config; - + function get_server_config($server_id, $section = '') { global $app; - + 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 == '') { return $this->config[$server_id]; } else { return $this->config[$server_id][$section]; } } - - function get_global_config() { - - die("not yet implemented"); - + + public function get_global_config($section = '') { + global $app; + + 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]; } + public function get_security_config($section = '') { + global $app; + + $app->uses('ini_parser'); + $security_config = $app->ini_parser->parse_ini_string(file_get_contents('/usr/local/ispconfig/security/security_settings.ini')); + + return ($section == '') ? $security_config : $security_config[$section]; + } + } -?> \ No newline at end of file +?> -- Gitblit v1.9.1