Check radius in sync pool
This commit is contained in:
parent
3ae81d0105
commit
bc763b476e
@ -21,7 +21,7 @@ class Mikrotik
|
||||
return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null);
|
||||
} catch (Exception $e) {
|
||||
$ui->assign("error_title", "Mikrotik Connection Error");
|
||||
$ui->assign("error_message", "Unable to connect to the router.<br>" . $e->getMessage());
|
||||
$ui->assign("error_message", "Unable to connect to the router : $ip<br>" . $e->getMessage() . '<br><pre>' . $e->getTraceAsString() . '</pre>');
|
||||
$ui->display('router-error.tpl');
|
||||
die();
|
||||
}
|
||||
|
@ -76,11 +76,13 @@ switch ($action) {
|
||||
$pools = ORM::for_table('tbl_pool')->find_many();
|
||||
$log = '';
|
||||
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;
|
||||
case 'add-post':
|
||||
|
Loading…
x
Reference in New Issue
Block a user