Skip to content

Commit e5322cb

Browse files
author
Marius Burkard
committed
Merge branch 'stable-3.1'
2 parents 178b34e + 04d8e6f commit e5322cb

File tree

12 files changed

+454
-461
lines changed

12 files changed

+454
-461
lines changed

interface/lib/app.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ public function log($msg, $priority = 0) {
195195
/*
196196
if (is_writable($this->_conf['log_file'])) {
197197
if (!$fp = fopen ($this->_conf['log_file'], 'a')) {
198-
$this->error('Unable to open logfile.');
198+
$this->error('Unable to open logfile: ' . $this->_conf['log_file']);
199199
}
200200
if (!fwrite($fp, date('d.m.Y-H:i').' - '. $msg."\r\n")) {
201-
$this->error('Unable to write to logfile.');
201+
$this->error('Unable to write to logfile: ' . $this->_conf['log_file']);
202202
}
203203
fclose($fp);
204204
} else {
205-
$this->error('Unable to write to logfile.');
205+
$this->error('Unable to write to logfile: ' . $this->_conf['log_file']);
206206
}
207207
*/
208208
}

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
?>

0 commit comments

Comments
 (0)