From 88bbf3ed35bc20dfd26b21ee87de554a1e5704b0 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Sun, 21 Apr 2024 20:51:44 +0700 Subject: [PATCH] fix lang.php --- system/controllers/home.php | 14 ++++++++------ system/lan/english.json | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/system/controllers/home.php b/system/controllers/home.php index f0fd4ee9..ecb6aaaa 100644 --- a/system/controllers/home.php +++ b/system/controllers/home.php @@ -142,12 +142,6 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) { } } if ($tur['status'] != 'on') { - $days = $config['extend_days']; - $expiration = date('Y-m-d', strtotime(" +$days day")); - $tur->expiration = $expiration; - $tur->status = "on"; - $tur->save(); - App::setToken(_get('stoken'), $id); if ($tur['routers'] != 'radius') { $mikrotik = Mikrotik::info($tur['routers']); $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); @@ -159,12 +153,20 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) { Radius::customerAddPlan($c, $p, $tur['expiration'] . ' ' . $tur['time']); } else { if ($tur['type'] == 'Hotspot') { + Mikrotik::removeHotspotUser($client, $c['username']); Mikrotik::addHotspotUser($client, $p, $c); } else if ($tur['type'] == 'PPPOE') { + Mikrotik::removePpoeUser($client, $c['username']); Mikrotik::addPpoeUser($client, $p, $c); } } // make customer cannot extend again + $days = $config['extend_days']; + $expiration = date('Y-m-d', strtotime(" +$days day")); + $tur->expiration = $expiration; + $tur->status = "on"; + $tur->save(); + App::setToken(_get('stoken'), $id); file_put_contents($path, $m); _log("Customer $tur[customer_id] $tur[username] extend for $days days", "Customer", $user['id']); r2(U . 'home', 's', "Extend until $expiration"); diff --git a/system/lan/english.json b/system/lan/english.json index 7303ac9a..a545f759 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -575,5 +575,7 @@ "Extend_Postpaid_Expiration": "Extend Postpaid Expiration", "Allow_Extend": "Allow Extend", "Extend_Days": "Extend Days", - "Confirmation_Message": "Confirmation Message" + "Confirmation_Message": "Confirmation Message", + "You_are_already_logged_in": "You are already logged in", + "Extend": "Extend" } \ No newline at end of file