diff --git a/interface/lib/classes/remote.d/admin.inc.php b/interface/lib/classes/remote.d/admin.inc.php index 793f9ed33966874010ecf7f6d50c618f06d6db3d..479b991b7b77d53595a69cf67f51c39ee71840ef 100644 --- a/interface/lib/classes/remote.d/admin.inc.php +++ b/interface/lib/classes/remote.d/admin.inc.php @@ -131,11 +131,10 @@ class remoting_admin extends remoting { /** 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 + @param string section of the config field in the table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc + @param string|null key of the option that you want to get */ - public function system_config_get($session_id, $section, $key) { + public function system_config_get($session_id, $section, $key = null) { 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.'); diff --git a/remoting_client/API-docs/navigation.html b/remoting_client/API-docs/navigation.html index 5168122f289ef728bbae26a09aab8f3f12be918a..d8c296801b5bce7aa7cfb0c74eaf6a47e06230fe 100644 --- a/remoting_client/API-docs/navigation.html +++ b/remoting_client/API-docs/navigation.html @@ -245,6 +245,7 @@ <p><a href="sites_web_subdomain_delete.html" target="content">sites_web_subdomain_delete</a></p> <p><a href="sites_web_subdomain_get.html" target="content">sites_web_subdomain_get</a></p> <p><a href="sites_web_subdomain_update.html" target="content">sites_web_subdomain_update</a></p> +<p><a href="system_config_get.html" target="content">system_config_get</a></p> <p><a href=""></a></p> <p></p> diff --git a/remoting_client/API-docs/system_config_get.html b/remoting_client/API-docs/system_config_get.html new file mode 100644 index 0000000000000000000000000000000000000000..7d73c974a337cf61e71da3ed882e9b881846d966 --- /dev/null +++ b/remoting_client/API-docs/system_config_get.html @@ -0,0 +1,29 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html><head><title>ISPCOnfig 3 remote API documentation</title> + + + + + + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <link rel="stylesheet" type="text/css" href="definitionen.css"> + <style type="text/css"> + </style></head> + +<body> +<div style="padding:40px"> +<h1>system_config_get(<span class="var">$session_id</span>, <span class="var">$section</span>, <span class="var">$key</span> ='');</h1> +<br> +<b>Description: </b> +<p class="margin"> Returns system config by section and optional key</p><br> +<b>Input Variables: </b> +<p class="margin"> <span class="var">$session_id</span>, <span class="var">$section</span>, <span class="var">$key</span> =''</p> +<b>Parameters (in <span class="var">$params</span>): </b> +<p class="margin"> None.</p> +<b>Output: </b> +<p class="margin"> Returns an array with the system config's section values, or a string with the value if a specific config key was requested.</p> +<!--<b>Output:</b> +<p style="margin-left:100px">Gives a record of </p> --> +</div> + +</body></html> diff --git a/remoting_client/examples/system_config_get.php b/remoting_client/examples/system_config_get.php new file mode 100644 index 0000000000000000000000000000000000000000..f5d3d47f7baff74fe42eaad58901a196a6add2d7 --- /dev/null +++ b/remoting_client/examples/system_config_get.php @@ -0,0 +1,48 @@ +<?php + +require 'soap_config.php'; + +$context = stream_context_create([ + 'ssl' => [ + // set some SSL/TLS specific options + 'verify_peer' => false, + 'verify_peer_name' => false, + 'allow_self_signed' => true + ] +]); + + +$client = new SoapClient(null, array('location' => $soap_location, + 'uri' => $soap_uri, + 'trace' => 1, + 'exceptions' => 1, + 'stream_context' => $context)); + + +try { + if($session_id = $client->login($username, $password)) { + echo 'Logged successfull. Session ID:'.$session_id.'<br />'; + } + + //* Set the function parameters. + $server_id = 1; + + $result = $client->system_config_get($session_id, 'misc'); + print_r($result); + echo "<br>"; + + $result = $client->system_config_get($session_id, 'misc', 'maintenance_mode'); + print_r($result); + echo "<br>"; + + if($client->logout($session_id)) { + echo 'Logged out.<br />'; + } + + +} catch (SoapFault $e) { + echo $client->__getLastResponse(); + die('SOAP Error: '.$e->getMessage()); +} + +?>