From efc0ba93b6055f3fa598b0c78df59ad4929a3d80 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Wed, 4 Oct 2023 11:25:58 +0700 Subject: [PATCH] allow radius pool --- system/controllers/autoload.php | 7 ++++++- system/controllers/pool.php | 2 +- ui/ui/pool-add.tpl | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/system/controllers/autoload.php b/system/controllers/autoload.php index b0e49618..9984947f 100644 --- a/system/controllers/autoload.php +++ b/system/controllers/autoload.php @@ -16,7 +16,12 @@ $ui->assign('_admin', $admin); switch ($action) { case 'pool': $routers = _get('routers'); - $d = ORM::for_table('tbl_pool')->where('routers', $routers)->find_many(); + if(empty($routers)){ + $d = ORM::for_table('tbl_pool')->find_many(); + }else{ + $d = ORM::for_table('tbl_pool')->where('routers', $routers)->find_many(); + } + $ui->assign('routers', $routers); $ui->assign('d', $d); $ui->display('autoload-pool.tpl'); break; diff --git a/system/controllers/pool.php b/system/controllers/pool.php index 7bea73a1..5fb65a52 100644 --- a/system/controllers/pool.php +++ b/system/controllers/pool.php @@ -100,7 +100,7 @@ switch ($action) { } $mikrotik = Mikrotik::info($routers); if ($msg == '') { - if (!$config['radius_enable']) { + if (!$config['radius_enable'] && $routers != 'radius') { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); Mikrotik::addPool($client, $name, $ip_address); } diff --git a/ui/ui/pool-add.tpl b/ui/ui/pool-add.tpl index 813be474..0424d5e5 100644 --- a/ui/ui/pool-add.tpl +++ b/ui/ui/pool-add.tpl @@ -23,6 +23,9 @@