set update-check-urls to api-version; started working on Customers-ApiCommand

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-16 10:56:27 +01:00
parent 4d12a4f37b
commit 2da2912c9c
5 changed files with 104 additions and 8 deletions

View File

@@ -10,7 +10,7 @@ class IpsAndPorts extends ApiCommand
$result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` ORDER BY `ip` ASC, `port` ASC
");
Database::pexecute($result_stmt);
Database::pexecute($result_stmt, null, true, true);
$result = array();
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
$result[] = $row;
@@ -174,12 +174,10 @@ class IpsAndPorts extends ApiCommand
if ($this->isAdmin() && $this->getUserDetail('change_serversettings')) {
$id = $this->getParam('id');
$result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `id` = :id
");
$result = Database::pexecute_first($result_stmt, array(
$json_result = IpsAndPorts::getLocal($this->getUserData(), array(
'id' => $id
), true, true);
))->get();
$result = json_decode($json_result, true)['data'];
$ip = validate_ip2($this->getParam('ip', $result['ip']), false, 'invalidip', false, false, false, true);
$port = validate($this->getParam('port', $result['port']), 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array(