update wa official API
This commit is contained in:
@@ -985,7 +985,7 @@ if (isset($_POST['finish'])) { // Assuming 'finish' is set in session when form
|
||||
$pdo->commit();
|
||||
|
||||
// Perform Mikrotik update
|
||||
$script = ':global hsa "";:global pppa "";:local id [/system license get software-id];:local idbm ($id."'.$lastInsertIdMikrotik.'");:local uptim [/system resource get uptime];:local bname [/system resource get board-name];:foreach i in=[/ppp active find] do={:local name [/ppp active get $i name];:local ip [/ppp active get $i address];:set $pppa ("$pppa$name_$ip|");};:foreach h in=[/ip hotspot user find comment!="" and uptime<20m] do={:local cek [:pick [/ip hotspot user get $h comment] 0 6];:if ($cek = "Login.") do={:local hsuser [/ip hotspot user get $h name];:local hscom [:pick [/ip hotspot user get $h comment] 6 50];:set $hsa ("$hsa$hsuser_$hscom|");}};/tool fetch url="https://bilspro.com/api/mikrotik.php" mode=https http-method=post http-data="{\"id\":\"$idbm\",\"bm\":\"$bname\",\"ut\":\"$uptim\",\"hsa\":\"$hsa\",\"pppa\":\"$pppa\"}" keep-result=no;:delay 1s;:set $pppa ("");:set $hsa ("");';
|
||||
$script = ':global hsa "";:global pppa "";:local id [/system license get software-id];:local idbm ($id."7");:local uptim [/system resource get uptime];:local bname [/system resource get board-name];:foreach i in=[/ppp active find] do={:local name [/ppp active get $i name];:local ip [/ppp active get $i address];:local mac [/ppp active get $i caller-id];:set $pppa ("$pppa$name_$ip_$mac|");};:foreach h in=[/ip hotspot user find comment!="" and uptime<20m] do={:local cek [:pick [/ip hotspot user get $h comment] 0 6];:if ($cek = "Login.") do={:local hsuser [/ip hotspot user get $h name];:local hscom [:pick [/ip hotspot user get $h comment] 6 50];:set $hsa ("$hsa$hsuser_$hscom|");}};/tool fetch url="https://manjapro.net/api/mikrotik.php" mode=https http-method=post http-data="{\"id\":\"$idbm\",\"bm\":\"$bname\",\"ut\":\"$uptim\",\"hsa\":\"$hsa\",\"pppa\":\"$pppa\"}" keep-result=no;:delay 1s;:set $pppa ("");:set $hsa ("");';
|
||||
|
||||
$API = new RouterosAPI();
|
||||
$API->debug = false;
|
||||
|
||||
Reference in New Issue
Block a user