From 3ca43c69a8df19adb22a901675df602631493edc Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 6 Aug 2024 10:21:26 +0700 Subject: [PATCH] allow $pppoe_username so it will back to customer username --- system/controllers/customers.php | 12 +++++++----- system/lan/english.json | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/system/controllers/customers.php b/system/controllers/customers.php index baee9405..511040e3 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -541,11 +541,13 @@ switch ($action) { $userDiff = true; } if ($oldPppoeUsername != $pppoe_username) { - if(ORM::for_table('tbl_customers')->where('pppoe_username', $pppoe_username)->find_one()){ - $msg.= Lang::T('PPPoE Username already used by another customer') . '
'; - } - if(ORM::for_table('tbl_customers')->where('username', $pppoe_username)->find_one()){ - $msg.= Lang::T('PPPoE Username already used by another customer') . '
'; + if(!empty($pppoe_username)){ + if(ORM::for_table('tbl_customers')->where('pppoe_username', $pppoe_username)->find_one()){ + $msg.= Lang::T('PPPoE Username already used by another customer') . '
'; + } + if(ORM::for_table('tbl_customers')->where('username', $pppoe_username)->find_one()){ + $msg.= Lang::T('PPPoE Username already used by another customer') . '
'; + } } $pppoeDiff = true; } diff --git a/system/lan/english.json b/system/lan/english.json index e775eb4f..5797a2d0 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -694,5 +694,6 @@ "_": "-", "Routers_Maps": "Routers Maps", "Routers_Geo_Location_Information": "Routers Geo Location Information", - "Coverage": "Coverage" + "Coverage": "Coverage", + "PPPoE_Username_already_used_by_another_customer": "PPPoE Username already used by another customer" } \ No newline at end of file