add first unit tests for DomainZones ApiCommand
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -347,7 +347,7 @@ class SubDomains extends ApiCommand implements ResourceEntity
|
||||
}
|
||||
if (count($customer_ids) > 0) {
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT d.*, pd.`subcanemaildomain`
|
||||
SELECT d.*, pd.`subcanemaildomain`, pd.`isbinddomain` as subisbinddomain
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "` d, `" . TABLE_PANEL_DOMAINS . "` pd
|
||||
WHERE " . ($id > 0 ? "d.`id` = :iddn" : "d.`domain` = :iddn") . " AND d.`customerid` IN (:customerids)
|
||||
AND ((d.`parentdomainid`!='0' AND pd.`id` = d.`parentdomainid`) OR (d.`parentdomainid`='0' AND pd.`id` = d.`id`))
|
||||
@@ -361,7 +361,7 @@ class SubDomains extends ApiCommand implements ResourceEntity
|
||||
}
|
||||
} else {
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT d.*, pd.`subcanemaildomain`
|
||||
SELECT d.*, pd.`subcanemaildomain`, pd.`isbinddomain` as subisbinddomain
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "` d, `" . TABLE_PANEL_DOMAINS . "` pd
|
||||
WHERE " . ($id > 0 ? "d.`id` = :iddn" : "d.`domain` = :iddn") . "
|
||||
AND ((d.`parentdomainid`!='0' AND pd.`id` = d.`parentdomainid`) OR (d.`parentdomainid`='0' AND pd.`id` = d.`id`))
|
||||
@@ -375,7 +375,7 @@ class SubDomains extends ApiCommand implements ResourceEntity
|
||||
throw new Exception("You cannot access this resource", 405);
|
||||
}
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT d.*, pd.`subcanemaildomain`
|
||||
SELECT d.*, pd.`subcanemaildomain`, pd.`isbinddomain` as subisbinddomain
|
||||
FROM `" . TABLE_PANEL_DOMAINS . "` d, `" . TABLE_PANEL_DOMAINS . "` pd
|
||||
WHERE d.`customerid`= :customerid AND " . ($id > 0 ? "d.`id` = :iddn" : "d.`domain` = :iddn") . "
|
||||
AND ((d.`parentdomainid`!='0' AND pd.`id` = d.`parentdomainid`) OR (d.`parentdomainid`='0' AND pd.`id` = d.`id`))
|
||||
|
||||
Reference in New Issue
Block a user