Routers can choose not to test it
This commit is contained in:
parent
8ea853c617
commit
0c8f590f85
@ -12,9 +12,7 @@ $ui->assign('_system_menu', 'network');
|
||||
$action = $routes['1'];
|
||||
$ui->assign('_admin', $admin);
|
||||
|
||||
use PEAR2\Net\RouterOS;
|
||||
|
||||
require_once 'system/autoload/PEAR2/Autoload.php';
|
||||
require_once $DEVICE_PATH . DIRECTORY_SEPARATOR . "MikrotikHotspot.php";
|
||||
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
@ -93,8 +91,10 @@ switch ($action) {
|
||||
}
|
||||
|
||||
if ($msg == '') {
|
||||
Mikrotik::getClient($ip_address, $username, $password);
|
||||
run_hook('add_router'); #HOOK
|
||||
if(_post("testIt")){
|
||||
(new MikrotikHotspot())->getClient($ip_address, $username, $password);
|
||||
}
|
||||
$d = ORM::for_table('tbl_routers')->create();
|
||||
$d->name = $name;
|
||||
$d->ip_address = $ip_address;
|
||||
@ -152,10 +152,11 @@ switch ($action) {
|
||||
$msg .= '<b>Radius</b> name is reserved<br>';
|
||||
}
|
||||
|
||||
|
||||
if ($msg == '') {
|
||||
Mikrotik::getClient($ip_address, $username, $password);
|
||||
run_hook('router_edit'); #HOOK
|
||||
if(_post("testIt")){
|
||||
(new MikrotikHotspot())->getClient($ip_address, $username, $password);
|
||||
}
|
||||
$d->name = $name;
|
||||
$d->ip_address = $ip_address;
|
||||
$d->username = $username;
|
||||
|
@ -53,6 +53,12 @@
|
||||
<p class="help-block">{Lang::T('Explain Coverage of router')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 control-label"></label>
|
||||
<div class="col-md-6">
|
||||
<label><input type="checkbox" name="testIt" value="yes"> Test Connection</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-primary"
|
||||
|
@ -52,6 +52,12 @@
|
||||
<p class="help-block">{Lang::T('Explain Coverage of router')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 control-label"></label>
|
||||
<div class="col-md-6">
|
||||
<label><input type="checkbox" name="testIt" value="yes"> Test Connection</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-primary" type="submit">{Lang::T('Save Changes')}</button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user