diff --git a/cp/app/Controllers/HomeController.php b/cp/app/Controllers/HomeController.php index b2f342c..e6f910e 100644 --- a/cp/app/Controllers/HomeController.php +++ b/cp/app/Controllers/HomeController.php @@ -112,11 +112,16 @@ class HomeController extends Controller $labels = []; $series = []; - foreach ($results as $row) { - $labels[] = $row['name']; // Registrar names for chart labels - $series[] = (int)$row['domain_count']; // Domain counts for chart data + if (is_array($results) || is_object($results)) { + foreach ($results as $row) { + $labels[] = $row['name']; // Registrar names for chart labels + $series[] = (int)$row['domain_count']; // Domain counts for chart data + } + } else { + $labels[] = 0; + $series[] = 0; } - + $query = " SELECT DATE(date_created) as ticket_date, diff --git a/cp/app/Controllers/RegistrarsController.php b/cp/app/Controllers/RegistrarsController.php index 1948d71..ddbff6d 100644 --- a/cp/app/Controllers/RegistrarsController.php +++ b/cp/app/Controllers/RegistrarsController.php @@ -629,7 +629,7 @@ class RegistrarsController extends Controller 'creditLimit' => $data['creditLimit'], 'creditThreshold' => $data['creditThreshold'], 'currency' => $currency, - 'lastupdate' => $crdate + 'lastupdate' => $update ]; if (!empty($data['eppPassword'])) { @@ -709,7 +709,7 @@ class RegistrarsController extends Controller ] ); - if (!empty($data['ipAddress'])) { + if (isset($data['ipAddress']) && $data['ipAddress']) { $db->delete( 'registrar_whitelist', [ @@ -728,7 +728,7 @@ class RegistrarsController extends Controller } } - if ($data['panelPassword']) { + if (isset($data['panelPassword']) && $data['panelPassword']) { $panelPassword = password_hash($data['panelPassword'], PASSWORD_ARGON2ID, ['memory_cost' => 1024 * 128, 'time_cost' => 6, 'threads' => 4]); $db->update( @@ -867,7 +867,7 @@ class RegistrarsController extends Controller 'abuse_email' => $data['abuseEmail'], 'abuse_phone' => $data['abusePhone'], 'currency' => $currency, - 'lastupdate' => $crdate + 'lastupdate' => $update ]; if (!empty($data['eppPassword'])) { @@ -947,7 +947,7 @@ class RegistrarsController extends Controller ] ); - if (!empty($data['ipAddress'])) { + if (isset($data['ipAddress']) && $data['ipAddress']) { $db->delete( 'registrar_whitelist', [ @@ -966,7 +966,7 @@ class RegistrarsController extends Controller } } - if ($data['panelPassword']) { + if (isset($data['panelPassword']) && $data['panelPassword']) { $panelPassword = password_hash($data['panelPassword'], PASSWORD_ARGON2ID, ['memory_cost' => 1024 * 128, 'time_cost' => 6, 'threads' => 4]); $db->update(