mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-02-24 15:36:33 +08:00
Fix router_name for log
This commit is contained in:
parent
f3d7687cdb
commit
009c890ab6
2 changed files with 35 additions and 2 deletions
|
@ -514,4 +514,37 @@ class Mikrotik
|
|||
->setArgument('message', $message);
|
||||
$client->sendSync($smsRequest);
|
||||
}
|
||||
|
||||
public static function addIpToAddressList($client, $ip, $listName, $comment = '')
|
||||
{
|
||||
global $_app_stage;
|
||||
if ($_app_stage == 'demo') {
|
||||
return null;
|
||||
}
|
||||
$addRequest = new RouterOS\Request('/ip/firewall/address-list/add');
|
||||
$client->sendSync(
|
||||
$addRequest
|
||||
->setArgument('address', $ip)
|
||||
->setArgument('comment', $comment)
|
||||
->setArgument('list', $listName)
|
||||
);
|
||||
}
|
||||
|
||||
public static function removeIpFromAddressList($client, $ip)
|
||||
{
|
||||
global $_app_stage;
|
||||
if ($_app_stage == 'demo') {
|
||||
return null;
|
||||
}
|
||||
$printRequest = new RouterOS\Request(
|
||||
'/ip firewall address-list print .proplist=.id',
|
||||
RouterOS\Query::where('address', $ip)
|
||||
);
|
||||
$id = $client->sendSync($printRequest)->getProperty('.id');
|
||||
$removeRequest = new RouterOS\Request('/ip/firewall/address-list/remove');
|
||||
$client->sendSync(
|
||||
$removeRequest
|
||||
->setArgument('numbers', $id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ foreach ($d as $ds) {
|
|||
echo "plan enabled: $p[enabled] | User balance: $c[balance] | price $p[price]\n";
|
||||
echo "auto renewall Failed\n";
|
||||
Message::sendTelegram("FAILED RENEWAL #cron\n\n#u$c[username] #buy #Hotspot \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nRouter: " . $p['routers'] .
|
||||
"\nPrice: " . $p['price']);
|
||||
}
|
||||
} else {
|
||||
|
@ -208,7 +208,7 @@ foreach ($d as $ds) {
|
|||
echo "plan enabled: $p[enabled] | User balance: $c[balance] | price $p[price]\n";
|
||||
echo "auto renewall Failed\n";
|
||||
Message::sendTelegram("FAILED RENEWAL #cron\n\n#u$c[username] #buy #PPPOE \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nRouter: " . $p['routers'] .
|
||||
"\nPrice: " . $p['price']);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue