Skip to content
Snippets Groups Projects
Commit b72e5ec3 authored by Webslice's avatar Webslice Committed by Till Brehm
Browse files

Feature/add api example system config get

parent 2cc5f036
No related branches found
No related tags found
No related merge requests found
......@@ -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.');
......
......@@ -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>
......
<!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>
<?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());
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment