From a4e8ae8c5c7fb9c820fa940259f75dd328de8bc2 Mon Sep 17 00:00:00 2001 From: gerandonk Date: Sun, 20 Oct 2024 01:07:00 +0700 Subject: [PATCH] make sync button not remove active hotspot user make sync button not remove active hotspot user --- system/devices/MikrotikHotspot.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/devices/MikrotikHotspot.php b/system/devices/MikrotikHotspot.php index 84c041f4..804c6892 100644 --- a/system/devices/MikrotikHotspot.php +++ b/system/devices/MikrotikHotspot.php @@ -33,8 +33,11 @@ class MikrotikHotspot { $mikrotik = $this->info($plan['routers']); $client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + $isExp = ORM::for_table('tbl_plans')->select("id")->where('plan_expired', $plan['id'])->find_one(); $this->removeHotspotUser($client, $customer['username']); + if ($isExp){ $this->removeHotspotActiveUser($client, $customer['username']); + } $this->addHotspotUser($client, $plan, $customer); }