From a09bfc01bfc46529c530ee22a8a85f40b494fe0c Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 6 Aug 2024 09:21:19 +0700 Subject: [PATCH] remove customer check pppoe_username --- system/devices/MikrotikPppoe.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system/devices/MikrotikPppoe.php b/system/devices/MikrotikPppoe.php index 486b85c..df55ee8 100644 --- a/system/devices/MikrotikPppoe.php +++ b/system/devices/MikrotikPppoe.php @@ -51,6 +51,8 @@ class MikrotikPppoe } if (!empty($customer['pppoe_ip'])) { $setRequest->setArgument('local-address', $customer['pppoe_ip']); + }else{ + $setRequest->setArgument('local-address', null); } $setRequest->setArgument('profile', $plan['name_plan']); $setRequest->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email'] . ' | ' . implode(', ', User::getBillNames($customer['id']))); @@ -72,8 +74,14 @@ class MikrotikPppoe $this->add_customer($customer, $p); } else { $this->removePpoeUser($client, $customer['username']); + if (!empty($customer['pppoe_username'])) { + $this->removePpoeUser($client, $customer['pppoe_username']); + } } $this->removePpoeActive($client, $customer['username']); + if (!empty($customer['pppoe_username'])) { + $this->removePpoeActive($client, $customer['pppoe_username']); + } } // customer change username