Fix loop disconnect to all Nas
Fix loop disconnect to all Nas but still detecting Hotspot Multylogin from other Nas
This commit is contained in:
parent
6f5d49cd2f
commit
ffa55cdee5
@ -301,7 +301,11 @@ class Radius
|
|||||||
if ($_app_stage == 'demo') {
|
if ($_app_stage == 'demo') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$nas = Radius::getTableNas()->findMany();
|
/**
|
||||||
|
* Fix loop to all Nas but still detecting Hotspot Multylogin from other Nas
|
||||||
|
*/
|
||||||
|
$act = ORM::for_table('radacct')->where_raw("acctstoptime IS NULL")->where('username', $username)->find_one();
|
||||||
|
$nas = Radius::getTableNas()->where('nasname', $act['nasipaddress'])->find_many();
|
||||||
$count = count($nas) * 15;
|
$count = count($nas) * 15;
|
||||||
set_time_limit($count);
|
set_time_limit($count);
|
||||||
$result = [];
|
$result = [];
|
||||||
@ -310,7 +314,7 @@ class Radius
|
|||||||
if (!empty($n['ports'])) {
|
if (!empty($n['ports'])) {
|
||||||
$port = $n['ports'];
|
$port = $n['ports'];
|
||||||
}
|
}
|
||||||
$result[] = $n['nasname'] . ': ' . @shell_exec("echo 'User-Name = $username' | " . Radius::getClient() . " " . trim($n['nasname']) . ":$port disconnect '" . $n['secret'] . "'");
|
$result[] = $n['nasname'] . ': ' . @shell_exec("echo 'User-Name = $username,Framed-IP-Address = " . $act['framedipaddress'] . "' | radclient -x " . trim($n['nasname']) . ":$port disconnect '" . $n['secret'] . "'");
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user