allow radius pool

This commit is contained in:
Ibnu Maksum 2023-10-04 11:25:58 +07:00
parent ce01771800
commit efc0ba93b6
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -23,6 +23,9 @@
<label class="col-md-2 control-label"><a href="{$_url}routers/add">{$_L['Routers']}</a></label>
<div class="col-md-6">
<select id="routers" name="routers" class="form-control select2">
{if $_c['radius_enable']}
<option value="radius">Radius</option>
{/if}
{foreach $r as $rs}
<option value="{$rs['name']}">{$rs['name']}</option>
{/foreach}