Compare commits

...

2 Commits
5.3 ... 5.5

Author SHA1 Message Date
90a08cb731 wrong hash default 2022-04-23 01:24:28 +07:00
5df998874a '/ppp/active/print' 2022-04-23 01:13:17 +07:00
2 changed files with 6 additions and 8 deletions

View File

@ -38,13 +38,13 @@ foreach ($d as $ds){
$u = ORM::for_table('tbl_user_recharges')->where('id',$ds['id'])->find_one();
$c = ORM::for_table('tbl_customers')->where('id',$ds['customer_id'])->find_one();
$m = ORM::for_table('tbl_routers')->where('name',$ds['routers'])->find_one();
try {
$client = new RouterOS\Client($m['ip_address'], $m['username'], $m['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
@ -64,7 +64,7 @@ foreach ($d as $ds){
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
//update database user dengan status off
$u->status = 'off';
$u->save();
@ -95,7 +95,7 @@ foreach ($d as $ds){
$client->sendSync($setRequest);
//remove hotspot active
$onlineRequest = new RouterOS\Request('/ppp/secret/print');
$onlineRequest = new RouterOS\Request('/ppp/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
@ -103,12 +103,10 @@ foreach ($d as $ds){
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
$u->status = 'off';
$u->save();
}else
echo " : ACTIVE \r\n";
}
}
?>

View File

@ -205,7 +205,7 @@ VALUES
1,
'admin',
'Administrator',
'YWRtaW46ODNlNDA2MGUtNzhlMS00ZmU1LTk5NzctYWVlY2NkNDZhMmI4',
'7c4a8d09ca3762af61e59520943dc26494f8941b',
'Admin',
'Active',
'2015-10-30 18:27:02',