diff --git a/system/autoload/Radius.php b/system/autoload/Radius.php index 9bdee13c..0ac1038c 100644 --- a/system/autoload/Radius.php +++ b/system/autoload/Radius.php @@ -301,7 +301,11 @@ class Radius if ($_app_stage == 'demo') { 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; set_time_limit($count); $result = []; @@ -310,7 +314,7 @@ class Radius if (!empty($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; }