Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
fix(getactivedomainswhmcs): fixed issue with foreach args
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed Mar 30, 2021
1 parent bcfa8af commit ccc2031
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions ispapi_monitoring.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,18 @@ private static function getActiveDomainsWHMCS()
if (!is_null($tmp)) {
return $tmp;
}
$result = DB::table("tbldomains")
$result = json_decode(DB::table("tbldomains")
->select("id", "domain", "idprotection", "additionalnotes", "is_premium")
->where([
["registrar", "=", "ispapi"],
["status", "=", "active"]
])
->get()->toJson();
->get()->toJson(), true);
$tmp = [];
foreach ($result as $row) {
$tmp[$row["domain"]] = $row;
if (!empty($result)) {
foreach ($result as $row) {
$tmp[$row["domain"]] = $row;
}
}
return $tmp;
}
Expand Down Expand Up @@ -426,9 +428,11 @@ private static function getDataWPAPICASE(&$data)
$domainsWHMCS = self::getActiveDomainsWHMCS();
$items = [];
$casesAPI = self::getIdProtectedDomainsAPI();
foreach ($casesAPI as $c) {
if (isset($domainsWHMCS[$c]) && empty($domainsWHMCS[$c]["is_premium"]) /* null, 0, empty str */) {
$items[] = $c;
if (!empty($casesAPI)) {
foreach ($casesAPI as $c) {
if (isset($domainsWHMCS[$c]) && empty($domainsWHMCS[$c]["is_premium"]) /* null, 0, empty str */) {
$items[] = $c;
}
}
}
if (!empty($items)) {
Expand All @@ -447,9 +451,11 @@ private static function getDataTLAPICASE(&$data)
$domainsWHMCS = self::getActiveDomainsWHMCS();
$items = [];
$casesAPI = self::getTransferUnlockedDomainsAPI();
foreach ($casesAPI as $c) {
if (isset($domainsWHMCS[$c])) {
$items[] = $c;
if (!empty($casesAPI)) {
foreach ($casesAPI as $c) {
if (isset($domainsWHMCS[$c])) {
$items[] = $c;
}
}
}
if (!empty($items)) {
Expand Down

0 comments on commit ccc2031

Please sign in to comment.