From c661976eaebf3018367e8cd0912893f59223cc6e Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Wed, 5 Jun 2024 17:37:01 +0700 Subject: [PATCH] new $p['device'] to (new $p['device']) --- system/autoload/Package.php | 6 +++--- system/controllers/accounts.php | 2 +- system/controllers/customers.php | 10 +++++----- system/controllers/home.php | 8 ++++---- system/controllers/plan.php | 6 +++--- system/controllers/services.php | 28 ++++++++++++++-------------- system/cron.php | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/system/autoload/Package.php b/system/autoload/Package.php index c406ee91..012f0d48 100644 --- a/system/autoload/Package.php +++ b/system/autoload/Package.php @@ -224,7 +224,7 @@ class Package $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_customer($c, $p); + (new $p['device'])->add_customer($c, $p); } else { new Exception(Lang::T("Devices Not Found")); } @@ -307,7 +307,7 @@ class Package $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_customer($c, $p); + (new $p['device'])->add_customer($c, $p); } else { new Exception(Lang::T("Devices Not Found")); } @@ -415,7 +415,7 @@ class Package $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->change_customer($b, $c, $p); + (new $p['device'])->change_customer($b, $c, $p); } else { new Exception(Lang::T("Devices Not Found")); } diff --git a/system/controllers/accounts.php b/system/controllers/accounts.php index ecd1cdc2..8c582f4d 100644 --- a/system/controllers/accounts.php +++ b/system/controllers/accounts.php @@ -46,7 +46,7 @@ switch ($action) { $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->remove_customer($c, $p); + (new $p['device'])->remove_customer($c, $p); } else { new Exception(Lang::T("Devices Not Found")); } diff --git a/system/controllers/customers.php b/system/controllers/customers.php index b268f033..5087c2a0 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -216,7 +216,7 @@ switch ($action) { $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->change_customer($c, $p); + (new $p['device'])->change_customer($c, $p); } else { new Exception(Lang::T("Devices Not Found")); } @@ -244,7 +244,7 @@ switch ($action) { $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_customer($c, $p); + (new $p['device'])->add_customer($c, $p); } else { new Exception(Lang::T("Devices Not Found")); } @@ -332,7 +332,7 @@ switch ($action) { $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->remove_customer($d, $p); + (new $p['device'])->remove_customer($d, $p); } else { new Exception(Lang::T("Devices Not Found")); } @@ -571,8 +571,8 @@ switch ($action) { $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->remove_customer($d, $p); - new $p['device']->add_customer($d, $p); + (new $p['device'])->remove_customer($d, $p); + (new $p['device'])->add_customer($d, $p); } else { new Exception(Lang::T("Devices Not Found")); } diff --git a/system/controllers/home.php b/system/controllers/home.php index 7d98d1c0..7c4cc59d 100644 --- a/system/controllers/home.php +++ b/system/controllers/home.php @@ -158,7 +158,7 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) { $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_customer($user, $p); + (new $p['device'])->add_customer($user, $p); } else { new Exception(Lang::T("Devices Not Found")); } @@ -190,7 +190,7 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) { $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->remove_customer($user, $p); + (new $p['device'])->remove_customer($user, $p); } else { new Exception(Lang::T("Devices Not Found")); } @@ -215,10 +215,10 @@ if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) { if (file_exists($dvc)) { require_once $dvc; if ($_GET['mikrotik'] == 'login') { - new $p['device']->connect_customer($user, $_SESSION['nux-ip'], $_SESSION['nux-mac'], $bill['routers']); + (new $p['device'])->connect_customer($user, $_SESSION['nux-ip'], $_SESSION['nux-mac'], $bill['routers']); r2(U . 'home', 's', Lang::T('Login Request successfully')); } else if ($_GET['mikrotik'] == 'logout') { - new $p['device']->disconnect_customer($user, $bill['routers']); + (new $p['device'])->disconnect_customer($user, $bill['routers']); r2(U . 'home', 's', Lang::T('Logout Request successfully')); } } else { diff --git a/system/controllers/plan.php b/system/controllers/plan.php index bc5b7bd4..3805721f 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -46,7 +46,7 @@ switch ($action) { $dvc = Package::getDevice($plan); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_customer($c, $p); + (new $p['device'])->add_customer($c, $p); } else { new Exception(Lang::T("Devices Not Found")); } @@ -260,7 +260,7 @@ switch ($action) { $p = ORM::for_table('tbl_plans')->find_one($d['plan_id']); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->remove_customer($c, $p); + (new $p['device'])->remove_customer($c, $p); } else { new Exception(Lang::T("Devices Not Found")); } @@ -776,7 +776,7 @@ switch ($action) { $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_customer($c, $p); + (new $p['device'])->add_customer($c, $p); } else { new Exception(Lang::T("Devices Not Found")); } diff --git a/system/controllers/services.php b/system/controllers/services.php index 2284ed7f..1510f1c4 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -30,14 +30,14 @@ switch ($action) { $dvc = Package::getDevice($plan); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_plan($plan); + (new $p['device'])->add_plan($plan); if (!empty($plan['pool_expired'])) { $plan->name_plan = 'EXPIRED NUXBILL ' . $pool_expired; $plan->rate_down_unit = "Kbps"; $plan->rate_up_unit == 'Kbps'; $plan->rate_up = '512'; $plan->rate_down = '512'; - new $p['device']->add_plan($plan); + (new $p['device'])->add_plan($plan); } } else { new Exception(Lang::T("Devices Not Found")); @@ -52,14 +52,14 @@ switch ($action) { $dvc = Package::getDevice($plan); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_plan($plan); + (new $p['device'])->add_plan($plan); if (!empty($plan['pool_expired'])) { $plan->name_plan = 'EXPIRED NUXBILL ' . $pool_expired; $plan->rate_down_unit = "Kbps"; $plan->rate_up_unit == 'Kbps'; $plan->rate_up = '512'; $plan->rate_down = '512'; - new $p['device']->add_plan($plan); + (new $p['device'])->add_plan($plan); } } else { new Exception(Lang::T("Devices Not Found")); @@ -119,7 +119,7 @@ switch ($action) { $dvc = Package::getDevice($d); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->remove_plan($d); + (new $p['device'])->remove_plan($d); } else { new Exception(Lang::T("Devices Not Found")); } @@ -223,14 +223,14 @@ switch ($action) { $dvc = Package::getDevice($d); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_plan($d); + (new $p['device'])->add_plan($d); if (!empty($pool_expired)) { $d->name_plan = 'EXPIRED NUXBILL ' . $pool_expired; $d->rate_down_unit = "Kbps"; $d->rate_up_unit == 'Kbps'; $d->rate_up = '512'; $d->rate_down = '512'; - new $p['device']->add_plan($d); + (new $p['device'])->add_plan($d); } } else { new Exception(Lang::T("Devices Not Found")); @@ -323,7 +323,7 @@ switch ($action) { $dvc = Package::getDevice($d); if (file_exists($dvc)) { require_once $dvc; - new $d['device']->update_plan($old, $d); + (new $d['device'])->update_plan($old, $d); if (!empty($pool_expired)) { $old->name_plan = 'EXPIRED NUXBILL ' . $old['pool_expired']; $d->name_plan = 'EXPIRED NUXBILL ' . $pool_expired; @@ -331,7 +331,7 @@ switch ($action) { $d->rate_up_unit == 'Kbps'; $d->rate_up = '512'; $d->rate_down = '512'; - new $d['device']->update_plan($old, $d); + (new $d['device'])->update_plan($old, $d); } } else { new Exception(Lang::T("Devices Not Found")); @@ -403,7 +403,7 @@ switch ($action) { $dvc = Package::getDevice($d); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->remove_plan($d); + (new $p['device'])->remove_plan($d); } else { new Exception(Lang::T("Devices Not Found")); } @@ -494,14 +494,14 @@ switch ($action) { $dvc = Package::getDevice($d); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->add_plan($d); + (new $p['device'])->add_plan($d); if (!empty($pool_expired)) { $d->name_plan = 'EXPIRED NUXBILL ' . $pool_expired; $d->rate_down_unit = "Kbps"; $d->rate_up_unit == 'Kbps'; $d->rate_up = '512'; $d->rate_down = '512'; - new $p['device']->add_plan($d); + (new $p['device'])->add_plan($d); } } else { new Exception(Lang::T("Devices Not Found")); @@ -583,7 +583,7 @@ switch ($action) { $dvc = Package::getDevice($d); if (file_exists($dvc)) { require_once $dvc; - new $d['device']->update_plan($old, $d); + (new $d['device'])->update_plan($old, $d); if (!empty($pool_expired)) { $old->name_plan = 'EXPIRED NUXBILL ' . $old['pool_expired']; $d->name_plan = 'EXPIRED NUXBILL ' . $pool_expired; @@ -591,7 +591,7 @@ switch ($action) { $d->rate_up_unit == 'Kbps'; $d->rate_up = '512'; $d->rate_down = '512'; - new $d['device']->update_plan($old, $d); + (new $d['device'])->update_plan($old, $d); } } else { new Exception(Lang::T("Devices Not Found")); diff --git a/system/cron.php b/system/cron.php index e56b7b5e..95981528 100644 --- a/system/cron.php +++ b/system/cron.php @@ -35,7 +35,7 @@ foreach ($d as $ds) { $dvc = Package::getDevice($p); if (file_exists($dvc)) { require_once $dvc; - new $p['device']->remove_customer($ds['routers'], $c, $p); + (new $p['device'])->remove_customer($ds['routers'], $c, $p); } else { echo "Cron error Devices $p[device] not found, cannot disconnect $c[username]"; Message::sendTelegram("Cron error Devices $p[device] not found, cannot disconnect $c[username]");