fix generation of current_ips array in Domains-API

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2023-04-25 20:09:18 +02:00
parent 1922b3ce65
commit 9c9771a371

View File

@@ -532,11 +532,11 @@ class Domains extends ApiCommand implements ResourceEntity
$mod_fcgid_starter = '-1'; $mod_fcgid_starter = '-1';
$mod_fcgid_maxrequests = '-1'; $mod_fcgid_maxrequests = '-1';
} }
if ($openbasedir_path > 2 && $openbasedir_path < 0) { if ($openbasedir_path > 2 && $openbasedir_path < 0) {
$openbasedir_path = 0; $openbasedir_path = 0;
} }
// check non-ssl IP // check non-ssl IP
$ipandports = $this->validateIpAddresses($p_ipandports); $ipandports = $this->validateIpAddresses($p_ipandports);
// check ssl IP // check ssl IP
@@ -1500,7 +1500,7 @@ class Domains extends ApiCommand implements ResourceEntity
$mod_fcgid_starter = $result['mod_fcgid_starter']; $mod_fcgid_starter = $result['mod_fcgid_starter'];
$mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests']; $mod_fcgid_maxrequests = $result['mod_fcgid_maxrequests'];
} }
// check changes of openbasedir-path variable // check changes of openbasedir-path variable
if ($openbasedir_path > 2 && $openbasedir_path < 0) { if ($openbasedir_path > 2 && $openbasedir_path < 0) {
$openbasedir_path = 0; $openbasedir_path = 0;
@@ -1966,7 +1966,10 @@ class Domains extends ApiCommand implements ResourceEntity
Database::pexecute($ip_sel_stmt, [ Database::pexecute($ip_sel_stmt, [
'id' => $id 'id' => $id
], true, true); ], true, true);
$current_ips = $ip_sel_stmt->fetchAll(\PDO::FETCH_ASSOC); $current_ips = [];
while ($cIP = $ip_sel_stmt->fetch(\PDO::FETCH_ASSOC)) {
$current_ips[] = $cIP['id_ipandports'];
}
// Cleanup domain <-> ip mapping // Cleanup domain <-> ip mapping
$del_stmt = Database::prepare(" $del_stmt = Database::prepare("