diff --git a/interface/lib/classes/remote.d/admin.inc.php b/interface/lib/classes/remote.d/admin.inc.php index a46c952a53f045943ee9d00f604c4354f3dbd326..7dd74438f38bf584fbc43bee9913bd763b0614c6 100644 --- a/interface/lib/classes/remote.d/admin.inc.php +++ b/interface/lib/classes/remote.d/admin.inc.php @@ -106,31 +106,55 @@ class remoting_admin extends remoting { /** Set a value in the system configuration @param int session id - @param int server id - @param string section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc + @param string section of the config field in the table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc @param string key of the option that you want to set @param string option value that you want to set */ - - public function system_config_set($session_id, $section, $key, $value) { - global $app; - if(!$this->checkPerm($session_id, 'system_config_set')) { - throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); - return false; - } - if ($section != '' && $key != '') { - $app->uses('remoting_lib,getconf,ini_parser'); - $system_config_array = $app->getconf->get_global_config(); - $system_config_array[$section][$key] = $value; - $system_config_str = $app->ini_parser->get_ini_string($system_config_array); - $app->db->datalogUpdate('sys_ini', array("config" => $system_config_str), 'sysini_id', 1); - } else { - throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.'); - return false; - } + global $app; + if(!$this->checkPerm($session_id, 'system_config_set')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if ($section != '' && $key != '') { + $app->uses('remoting_lib,getconf,ini_parser'); + $system_config_array = $app->getconf->get_global_config(); + $system_config_array[$section][$key] = $value; + $system_config_str = $app->ini_parser->get_ini_string($system_config_array); + $app->db->datalogUpdate('sys_ini', array("config" => $system_config_str), 'sysini_id', 1); + } else { + throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.'); + return false; + } } + /** + Get the values of the system configuration + @param int session id + @param string section of the config field in the table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc + @param string key of the option that you want to set + @param string option value that you want to set + */ + public function system_config_get($session_id, $section, $key) { + global $app; + if(!$this->checkPerm($session_id, 'system_config_get')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if ($section != '') { + $app->uses('remoting_lib,getconf,ini_parser'); + $system_config_array = $app->getconf->get_global_config(); + if($key != '') { + if(isset($system_config_array[$section][$key])) return $system_config_array[$section][$key]; + else return false; + } else { + if(isset($system_config_array[$section])) return $system_config_array[$section]; + else return false; + } else { + throw new SoapFault('invalid_function_parameter', 'Invalid function parameter.'); + return false; + } + } } diff --git a/interface/web/admin/lib/remote.conf.php b/interface/web/admin/lib/remote.conf.php index 5e711fac6bb3a2e5422b37a4fa65042cd0db35de..01e03695f839720f73ea61e233d97c54a88f7d8c 100644 --- a/interface/web/admin/lib/remote.conf.php +++ b/interface/web/admin/lib/remote.conf.php @@ -1,6 +1,6 @@