Skip to content

Commit 9d417c0

Browse files
author
Till Brehm
committed
Implements new API functions #5215 and #5202
1 parent 64be2d7 commit 9d417c0

File tree

8 files changed

+224
-0
lines changed

8 files changed

+224
-0
lines changed

interface/lib/classes/remote.d/admin.inc.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,49 @@ public function config_value_delete($session_id, $group, $name)
272272

273273
return $app->db->query('DELETE FROM sys_config WHERE `group` = ? AND `name` = ?',$group,$name);
274274
}
275+
276+
// Get datalog information with tstamp >=
277+
public function sys_datalog_get_by_tstamp($session_id, $tstamp)
278+
{
279+
global $app;
280+
281+
if(!$this->checkPerm($session_id, 'server_get')) {
282+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
283+
return false;
284+
}
285+
286+
$tstamp = $app->functions->intval($tstamp);
287+
288+
if($tstamp > 0) {
289+
$rec = $app->db->queryAllRecords("SELECT datalog_id, server_id, dbtable, dbidx, action, tstamp, user, data, status, error FROM sys_datalog WHERE tstamp >= ? ORDER BY datalog_id DESC", $tstamp);
290+
return $rec;
291+
}
292+
}
293+
294+
// Get datalog information by datalog_id
295+
public function sys_datalog_get($session_id, $datalog_id, $newer = false)
296+
{
297+
global $app;
298+
299+
if(!$this->checkPerm($session_id, 'server_get')) {
300+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
301+
return false;
302+
}
303+
304+
$tstamp = $app->functions->intval($tstamp);
305+
306+
if($datalog_id > 0 && $newer === true) {
307+
$rec = $app->db->queryAllRecords("SELECT datalog_id, server_id, dbtable, dbidx, action, tstamp, user, data, status, error FROM sys_datalog WHERE datalog_id >= ? ORDER BY datalog_id DESC", $datalog_id);
308+
return $rec;
309+
} elseif ($datalog_id > 0) {
310+
$rec = $app->db->queryAllRecords("SELECT datalog_id, server_id, dbtable, dbidx, action, tstamp, user, data, status, error FROM sys_datalog WHERE datalog_id = ? ORDER BY datalog_id DESC", $datalog_id);
311+
return $rec;
312+
} else {
313+
throw new SoapFault('invalid_datalog_id', 'The ID passed to the function must be > 0');
314+
return false;
315+
}
316+
}
317+
275318

276319
}
277320

interface/lib/classes/remote.d/client.inc.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,27 @@ public function client_login_get($session_id,$username,$password,$remote_ip = ''
678678

679679
return $returnval;
680680
}
681+
682+
public function client_get_by_groupid($session_id, $group_id)
683+
{
684+
global $app;
685+
if(!$this->checkPerm($session_id, 'client_get_id')) {
686+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
687+
return false;
688+
}
689+
690+
$group_id = $app->functions->intval($group_id);
691+
692+
$rec = $app->db->queryOneRecord("SELECT client_id FROM sys_group WHERE groupid = ?", $group_id);
693+
if(isset($rec['client_id'])) {
694+
$client_id = $app->functions->intval($rec['client_id']);
695+
return $this->client_get($session_id, $client_id);
696+
} else {
697+
throw new SoapFault('no_group_found', 'There is no client for this group ID.');
698+
return false;
699+
}
700+
}
701+
681702
}
682703

683704
?>

interface/lib/classes/remote.d/dns.inc.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,21 @@ public function dns_zone_get($session_id, $primary_id)
197197
return $app->remoting_lib->getDataRecord($primary_id);
198198
}
199199

200+
//* Get slave zone details
201+
public function dns_slave_get($session_id, $primary_id)
202+
{
203+
global $app;
204+
205+
if(!$this->checkPerm($session_id, 'dns_zone_get')) {
206+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
207+
return false;
208+
}
209+
$app->uses('remoting_lib');
210+
$app->remoting_lib->loadFormDef('../dns/form/dns_slave.tform.php');
211+
return $app->remoting_lib->getDataRecord($primary_id);
212+
}
213+
214+
200215
//* Add a slave zone
201216
public function dns_slave_add($session_id, $client_id, $params)
202217
{
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<html><head><title>ISPCOnfig 3 remote API documentation</title>
3+
4+
5+
6+
7+
8+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9+
<link rel="stylesheet" type="text/css" href="definitionen.css">
10+
<style type="text/css">
11+
</style></head>
12+
13+
<body>
14+
<div style="padding:40px">
15+
<h1>client_get_by_groupid(<span class="var">$session_id</span>, <span class="var">$groupid</span>);</h1>
16+
<br>
17+
<p class="headgrp">Description: </p>
18+
<p class="margin"> Shows client information of user.</p><br>
19+
<p class="headgrp">Input Variables: </p>
20+
<p class="margin"> <span class="var">$session_id</span>, <span class="var">$groupid</span></p>
21+
<p class="headgrp">Parameters (in <span class="var">$params</span>): </p>
22+
<p class="margin"> None</p>
23+
<p class="headgrp">Output: </p>
24+
<p class="margin"> Returns client information from client tyble by groupid of that client.</p>
25+
<!--<b>Output:</b>
26+
<p style="margin-left:100px">Gives a record of </p> -->
27+
</div>
28+
29+
</body></html>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<html><head><title>ISPCOnfig 3 remote API documentation</title>
3+
4+
5+
6+
7+
8+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9+
<link rel="stylesheet" type="text/css" href="definitionen.css">
10+
<style type="text/css">
11+
</style></head>
12+
13+
<body>
14+
<div style="padding:40px">
15+
<h1>dns_slave_delete(<span class="var">$session_id</span>, <span class="var">$primary_id</span>);</h1>
16+
<br>
17+
<p class="headgrp">Description: </p>
18+
<p class="margin"> Deletes a dns slave zone.</p><br>
19+
<p class="headgrp">Input Variables: </p>
20+
<p class="margin"> <span class="var">$session_id</span>, <span class="var">$primary_id</span></p>
21+
<p class="headgrp">Parameters (in <span class="var">$params</span>): </p>
22+
<p class="margin">None</p>
23+
<p class="headgrp">Output: </p>
24+
<p class="margin"> Returns the number of deleted records.</p>
25+
<!--<b>Output:</b>
26+
<p style="margin-left:100px">Gives a record of </p> -->
27+
</div>
28+
29+
</body></html>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<html><head><title>ISPCOnfig 3 remote API documentation</title>
3+
4+
5+
6+
7+
8+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9+
<link rel="stylesheet" type="text/css" href="definitionen.css">
10+
<style type="text/css">
11+
</style></head>
12+
13+
<body>
14+
<div style="padding:40px">
15+
<h1>dns_slave_get(<span class="var">$session_id</span>, <span class="var">$primary_id</span>);</h1>
16+
<br>
17+
<p class="headgrp">Description: </p>
18+
<p class="margin"> Retrieves information about a dns slave zone.</p><br>
19+
<p class="headgrp">Input Variables: </p>
20+
<p class="margin"> <span class="var">$session_id</span>, <span class="var">$primary_id</span></p>
21+
<p class="headgrp">Parameters (in <span class="var">$params</span>): </p>
22+
<p class="margin"> None</p>
23+
<p class="headgrp">Output: </p>
24+
<p class="margin"> Returns all fields and values of the chosen dns slave zone.</p>
25+
<!--<b>Output:</b>
26+
<p style="margin-left:100px">Gives a record of </p> -->
27+
</div>
28+
29+
</body></html>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<html><head><title>ISPCOnfig 3 remote API documentation</title>
3+
4+
5+
6+
7+
8+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9+
<link rel="stylesheet" type="text/css" href="definitionen.css">
10+
<style type="text/css">
11+
</style></head>
12+
13+
<body>
14+
<div style="padding:40px">
15+
<h1>sys_datalog_get(<span class="var">$session_id</span>, <span class="var">$datalog_id</span>, <span class="var">$newer</span>);</h1>
16+
<br>
17+
<p class="headgrp">Description: </p>
18+
<p class="margin"> Retrieves information from sys_datalog.</p><br>
19+
<p class="headgrp">Input Variables: </p>
20+
<p class="margin"> <span class="var">$session_id</span>, <span class="var">$datalog_id</span>, <span class="var">$newer (true/false)</span></p>
21+
<p class="headgrp">Parameters (in <span class="var">$params</span>): </p>
22+
<p class="margin"> None</p>
23+
<p class="headgrp">Output: </p>
24+
<p class="margin"> Returns all fields and values of the chosen dns slave zone.</p>
25+
<!--<b>Output:</b>
26+
<p style="margin-left:100px">Gives a record of </p> -->
27+
</div>
28+
29+
</body></html>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2+
<html><head><title>ISPCOnfig 3 remote API documentation</title>
3+
4+
5+
6+
7+
8+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9+
<link rel="stylesheet" type="text/css" href="definitionen.css">
10+
<style type="text/css">
11+
</style></head>
12+
13+
<body>
14+
<div style="padding:40px">
15+
<h1>sys_datalog_get_by_tstamp(<span class="var">$session_id</span>, <span class="var">$tstamp</span>);</h1>
16+
<br>
17+
<p class="headgrp">Description: </p>
18+
<p class="margin"> Retrieves information from sys_datalog by timestamp. All records that are newer or same than given timestamp are returned.</p><br>
19+
<p class="headgrp">Input Variables: </p>
20+
<p class="margin"> <span class="var">$session_id</span>, <span class="var">$tstamp</span></p>
21+
<p class="headgrp">Parameters (in <span class="var">$params</span>): </p>
22+
<p class="margin"> None</p>
23+
<p class="headgrp">Output: </p>
24+
<p class="margin"> Returns all fields and values of the chosen dns slave zone.</p>
25+
<!--<b>Output:</b>
26+
<p style="margin-left:100px">Gives a record of </p> -->
27+
</div>
28+
29+
</body></html>

0 commit comments

Comments
 (0)