From b232ccddbf7401520e400aeb86f94b19a86b5203 Mon Sep 17 00:00:00 2001 From: iBNu Maksum Date: Thu, 16 Jan 2025 09:54:48 +0700 Subject: [PATCH] online_customer using pppoe_username --- system/devices/MikrotikPppoe.php | 14 +++++++++++--- version.json | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/system/devices/MikrotikPppoe.php b/system/devices/MikrotikPppoe.php index a3419d52..7b3fdac6 100644 --- a/system/devices/MikrotikPppoe.php +++ b/system/devices/MikrotikPppoe.php @@ -77,9 +77,9 @@ class MikrotikPppoe } } } - + function sync_customer($customer, $plan) - { + { $this->add_customer($customer, $plan); } @@ -304,7 +304,15 @@ class MikrotikPppoe '/ppp active print', RouterOS\Query::where('name', $customer['username']) ); - return $client->sendSync($printRequest)->getProperty('.id'); + $id = $client->sendSync($printRequest)->getProperty('.id'); + if(empty($id)){ + $printRequest = new RouterOS\Request( + '/ppp active print', + RouterOS\Query::where('name', $customer['pppoe_username']) + ); + $id = $client->sendSync($printRequest)->getProperty('.id'); + } + return $id; } function info($name) diff --git a/version.json b/version.json index 80f132cc..9b836b0c 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2025.1.7" + "version": "2025.1.16" } \ No newline at end of file