Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Massimiliano
ISPConfig 3
Commits
9d417c0d
Commit
9d417c0d
authored
Jan 08, 2019
by
Till Brehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implements new API functions #5215 and #5202
parent
64be2d74
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
224 additions
and
0 deletions
+224
-0
interface/lib/classes/remote.d/admin.inc.php
interface/lib/classes/remote.d/admin.inc.php
+43
-0
interface/lib/classes/remote.d/client.inc.php
interface/lib/classes/remote.d/client.inc.php
+21
-0
interface/lib/classes/remote.d/dns.inc.php
interface/lib/classes/remote.d/dns.inc.php
+15
-0
remoting_client/API-docs/client_get_by_groupid.html
remoting_client/API-docs/client_get_by_groupid.html
+29
-0
remoting_client/API-docs/dns_slave_delete.html
remoting_client/API-docs/dns_slave_delete.html
+29
-0
remoting_client/API-docs/dns_slave_get.html
remoting_client/API-docs/dns_slave_get.html
+29
-0
remoting_client/API-docs/sys_datalog_get.html
remoting_client/API-docs/sys_datalog_get.html
+29
-0
remoting_client/API-docs/sys_datalog_get_by_tstamp.html
remoting_client/API-docs/sys_datalog_get_by_tstamp.html
+29
-0
No files found.
interface/lib/classes/remote.d/admin.inc.php
View file @
9d417c0d
...
...
@@ -272,6 +272,49 @@ class remoting_admin extends remoting {
return
$app
->
db
->
query
(
'DELETE FROM sys_config WHERE `group` = ? AND `name` = ?'
,
$group
,
$name
);
}
// Get datalog information with tstamp >=
public
function
sys_datalog_get_by_tstamp
(
$session_id
,
$tstamp
)
{
global
$app
;
if
(
!
$this
->
checkPerm
(
$session_id
,
'server_get'
))
{
throw
new
SoapFault
(
'permission_denied'
,
'You do not have the permissions to access this function.'
);
return
false
;
}
$tstamp
=
$app
->
functions
->
intval
(
$tstamp
);
if
(
$tstamp
>
0
)
{
$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
);
return
$rec
;
}
}
// Get datalog information by datalog_id
public
function
sys_datalog_get
(
$session_id
,
$datalog_id
,
$newer
=
false
)
{
global
$app
;
if
(
!
$this
->
checkPerm
(
$session_id
,
'server_get'
))
{
throw
new
SoapFault
(
'permission_denied'
,
'You do not have the permissions to access this function.'
);
return
false
;
}
$tstamp
=
$app
->
functions
->
intval
(
$tstamp
);
if
(
$datalog_id
>
0
&&
$newer
===
true
)
{
$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
);
return
$rec
;
}
elseif
(
$datalog_id
>
0
)
{
$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
);
return
$rec
;
}
else
{
throw
new
SoapFault
(
'invalid_datalog_id'
,
'The ID passed to the function must be > 0'
);
return
false
;
}
}
}
...
...
interface/lib/classes/remote.d/client.inc.php
View file @
9d417c0d
...
...
@@ -678,6 +678,27 @@ class remoting_client extends remoting {
return
$returnval
;
}
public
function
client_get_by_groupid
(
$session_id
,
$group_id
)
{
global
$app
;
if
(
!
$this
->
checkPerm
(
$session_id
,
'client_get_id'
))
{
throw
new
SoapFault
(
'permission_denied'
,
'You do not have the permissions to access this function.'
);
return
false
;
}
$group_id
=
$app
->
functions
->
intval
(
$group_id
);
$rec
=
$app
->
db
->
queryOneRecord
(
"SELECT client_id FROM sys_group WHERE groupid = ?"
,
$group_id
);
if
(
isset
(
$rec
[
'client_id'
]))
{
$client_id
=
$app
->
functions
->
intval
(
$rec
[
'client_id'
]);
return
$this
->
client_get
(
$session_id
,
$client_id
);
}
else
{
throw
new
SoapFault
(
'no_group_found'
,
'There is no client for this group ID.'
);
return
false
;
}
}
}
?>
interface/lib/classes/remote.d/dns.inc.php
View file @
9d417c0d
...
...
@@ -197,6 +197,21 @@ class remoting_dns extends remoting {
return
$app
->
remoting_lib
->
getDataRecord
(
$primary_id
);
}
//* Get slave zone details
public
function
dns_slave_get
(
$session_id
,
$primary_id
)
{
global
$app
;
if
(
!
$this
->
checkPerm
(
$session_id
,
'dns_zone_get'
))
{
throw
new
SoapFault
(
'permission_denied'
,
'You do not have the permissions to access this function.'
);
return
false
;
}
$app
->
uses
(
'remoting_lib'
);
$app
->
remoting_lib
->
loadFormDef
(
'../dns/form/dns_slave.tform.php'
);
return
$app
->
remoting_lib
->
getDataRecord
(
$primary_id
);
}
//* Add a slave zone
public
function
dns_slave_add
(
$session_id
,
$client_id
,
$params
)
{
...
...
remoting_client/API-docs/client_get_by_groupid.html
0 → 100644
View file @
9d417c0d
<!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>
client_get_by_groupid(
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$groupid
</span>
);
</h1>
<br>
<p
class=
"headgrp"
>
Description:
</p>
<p
class=
"margin"
>
Shows client information of user.
</p><br>
<p
class=
"headgrp"
>
Input Variables:
</p>
<p
class=
"margin"
>
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$groupid
</span></p>
<p
class=
"headgrp"
>
Parameters (in
<span
class=
"var"
>
$params
</span>
):
</p>
<p
class=
"margin"
>
None
</p>
<p
class=
"headgrp"
>
Output:
</p>
<p
class=
"margin"
>
Returns client information from client tyble by groupid of that client.
</p>
<!--<b>Output:</b>
<p style="margin-left:100px">Gives a record of </p> -->
</div>
</body></html>
remoting_client/API-docs/dns_slave_delete.html
0 → 100644
View file @
9d417c0d
<!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>
dns_slave_delete(
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$primary_id
</span>
);
</h1>
<br>
<p
class=
"headgrp"
>
Description:
</p>
<p
class=
"margin"
>
Deletes a dns slave zone.
</p><br>
<p
class=
"headgrp"
>
Input Variables:
</p>
<p
class=
"margin"
>
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$primary_id
</span></p>
<p
class=
"headgrp"
>
Parameters (in
<span
class=
"var"
>
$params
</span>
):
</p>
<p
class=
"margin"
>
None
</p>
<p
class=
"headgrp"
>
Output:
</p>
<p
class=
"margin"
>
Returns the number of deleted records.
</p>
<!--<b>Output:</b>
<p style="margin-left:100px">Gives a record of </p> -->
</div>
</body></html>
remoting_client/API-docs/dns_slave_get.html
0 → 100644
View file @
9d417c0d
<!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>
dns_slave_get(
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$primary_id
</span>
);
</h1>
<br>
<p
class=
"headgrp"
>
Description:
</p>
<p
class=
"margin"
>
Retrieves information about a dns slave zone.
</p><br>
<p
class=
"headgrp"
>
Input Variables:
</p>
<p
class=
"margin"
>
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$primary_id
</span></p>
<p
class=
"headgrp"
>
Parameters (in
<span
class=
"var"
>
$params
</span>
):
</p>
<p
class=
"margin"
>
None
</p>
<p
class=
"headgrp"
>
Output:
</p>
<p
class=
"margin"
>
Returns all fields and values of the chosen dns slave zone.
</p>
<!--<b>Output:</b>
<p style="margin-left:100px">Gives a record of </p> -->
</div>
</body></html>
remoting_client/API-docs/sys_datalog_get.html
0 → 100644
View file @
9d417c0d
<!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>
sys_datalog_get(
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$datalog_id
</span>
,
<span
class=
"var"
>
$newer
</span>
);
</h1>
<br>
<p
class=
"headgrp"
>
Description:
</p>
<p
class=
"margin"
>
Retrieves information from sys_datalog.
</p><br>
<p
class=
"headgrp"
>
Input Variables:
</p>
<p
class=
"margin"
>
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$datalog_id
</span>
,
<span
class=
"var"
>
$newer (true/false)
</span></p>
<p
class=
"headgrp"
>
Parameters (in
<span
class=
"var"
>
$params
</span>
):
</p>
<p
class=
"margin"
>
None
</p>
<p
class=
"headgrp"
>
Output:
</p>
<p
class=
"margin"
>
Returns all fields and values of the chosen dns slave zone.
</p>
<!--<b>Output:</b>
<p style="margin-left:100px">Gives a record of </p> -->
</div>
</body></html>
remoting_client/API-docs/sys_datalog_get_by_tstamp.html
0 → 100644
View file @
9d417c0d
<!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>
sys_datalog_get_by_tstamp(
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$tstamp
</span>
);
</h1>
<br>
<p
class=
"headgrp"
>
Description:
</p>
<p
class=
"margin"
>
Retrieves information from sys_datalog by timestamp. All records that are newer or same than given timestamp are returned.
</p><br>
<p
class=
"headgrp"
>
Input Variables:
</p>
<p
class=
"margin"
>
<span
class=
"var"
>
$session_id
</span>
,
<span
class=
"var"
>
$tstamp
</span></p>
<p
class=
"headgrp"
>
Parameters (in
<span
class=
"var"
>
$params
</span>
):
</p>
<p
class=
"margin"
>
None
</p>
<p
class=
"headgrp"
>
Output:
</p>
<p
class=
"margin"
>
Returns all fields and values of the chosen dns slave zone.
</p>
<!--<b>Output:</b>
<p style="margin-left:100px">Gives a record of </p> -->
</div>
</body></html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment