From 349a1d325034e24d7720984a17bf2d454e98a833 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 20 Feb 2024 10:07:07 +0700 Subject: [PATCH] add to Address List --- system/controllers/services.php | 6 +++++- system/cron.php | 2 ++ system/lan/english.json | 3 ++- ui/ui/hotspot-add.tpl | 33 ++------------------------------- ui/ui/hotspot-edit.tpl | 7 +++++++ ui/ui/hotspot.tpl | 2 +- ui/ui/pppoe-add.tpl | 9 ++++++++- ui/ui/pppoe-edit.tpl | 16 +++++++++++----- ui/ui/pppoe.tpl | 2 +- update.php | 3 ++- 10 files changed, 41 insertions(+), 42 deletions(-) diff --git a/system/controllers/services.php b/system/controllers/services.php index 38d2a29a..a46b1754 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -470,6 +470,7 @@ switch ($action) { $routers = _post('routers'); $pool = _post('pool_name'); $pool_expired = _post('pool_expired'); + $list_expired = _post('list_expired'); $enabled = _post('enabled'); $allow_purchase = _post('allow_purchase'); @@ -529,8 +530,9 @@ switch ($action) { } else { $d->is_radius = 0; $d->routers = $routers; - $d->pool_expired = $pool_expired; } + $d->pool_expired = $pool_expired; + $d->list_expired = $list_expired; $d->enabled = $enabled; $d->allow_purchase = $allow_purchase; $d->save(); @@ -563,6 +565,7 @@ switch ($action) { $routers = _post('routers'); $pool = _post('pool_name'); $pool_expired = _post('pool_expired'); + $list_expired = _post('list_expired'); $enabled = _post('enabled'); $allow_purchase = _post('allow_purchase'); @@ -622,6 +625,7 @@ switch ($action) { $d->routers = $routers; $d->pool = $pool; $d->pool_expired = $pool_expired; + $d->list_expired = $list_expired; $d->enabled = $enabled; $d->allow_purchase = $allow_purchase; $d->save(); diff --git a/system/cron.php b/system/cron.php index 13526655..e3cdd5b2 100644 --- a/system/cron.php +++ b/system/cron.php @@ -46,6 +46,8 @@ foreach ($d as $ds) { $client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']); if (!empty($p['pool_expired'])) { Mikrotik::setHotspotUserPackage($client, $c['username'], 'EXPIRED NUXBILL ' . $p['pool_expired']); + }if (!empty($p['list_expired'])) { + Mikrotik::addIpToAddressList($client, $ip, $p['list_expired'], $c['username']); } else { Mikrotik::removeHotspotUser($client, $c['username']); } diff --git a/system/lan/english.json b/system/lan/english.json index bdf1f135..0f7f8bd3 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -417,5 +417,6 @@ "Login": "Login", "Expired_Action": "Expired Action", "Expired_Address_List_Name": "Expired Address List Name", - "Address_List": "Address List" + "Address_List": "Address List", + "Optional": "Optional" } \ No newline at end of file diff --git a/ui/ui/hotspot-add.tpl b/ui/ui/hotspot-add.tpl index 37784ee2..5d4c43be 100644 --- a/ui/ui/hotspot-add.tpl +++ b/ui/ui/hotspot-add.tpl @@ -147,19 +147,7 @@ -
- -
- -    - -    - -
-
+ {Lang::T('Expired Action')} {Lang::T('Optional')}
@@ -169,7 +157,7 @@
- +
+ +
+ +
+
-
+ {Lang::T('Expired Action')} {Lang::T('Optional')} +
@@ -100,6 +101,12 @@
+
+ +
+ +
+
+
+ +
+ +
+
+ {Lang::T('Expired Action')} {Lang::T('Optional')}
@@ -100,14 +108,12 @@
-
- +
+
- +
-