mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-03 17:54:41 +02:00
Check radius in sync pool
This commit is contained in:
parent
3ae81d0105
commit
bc763b476e
2 changed files with 9 additions and 7 deletions
|
@ -62,7 +62,7 @@ switch ($action) {
|
|||
$d = ORM::for_table('tbl_pool')->find_one($id);
|
||||
$mikrotik = Mikrotik::info($d['routers']);
|
||||
if ($d) {
|
||||
if ($d['routers']!='radius') {
|
||||
if ($d['routers'] != 'radius') {
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::removePool($client, $d['pool_name']);
|
||||
}
|
||||
|
@ -75,11 +75,13 @@ switch ($action) {
|
|||
case 'sync':
|
||||
$pools = ORM::for_table('tbl_pool')->find_many();
|
||||
$log = '';
|
||||
foreach($pools as $pool){
|
||||
$mikrotik = Mikrotik::info($pool['routers']);
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::addPool($client, $pool['pool_name'], $pool['range_ip']);
|
||||
$log .= 'DONE: '.$pool['pool_name'].': '.$pool['range_ip'].'<br>';
|
||||
foreach ($pools as $pool) {
|
||||
if ($pool['routers'] != 'radius') {
|
||||
$mikrotik = Mikrotik::info($pool['routers']);
|
||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
Mikrotik::addPool($client, $pool['pool_name'], $pool['range_ip']);
|
||||
$log .= 'DONE: ' . $pool['pool_name'] . ': ' . $pool['range_ip'] . '<br>';
|
||||
}
|
||||
}
|
||||
r2(U . 'pool/list', 's', $log);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue