I have a workable command for PEAR2\Net\RouterOS:
/ppp secret remove numbers=$username
Now, I need compatible code for routeros_api.class.php
The below is my code which is not working:
Code: Select all
require '../routeros_api.class.php';
$API = new RouterosAPI();
$API->debug = true;
$username = "TEST"; // asumig this user already added in PPP secrets
if ($API->connect('111.111.111.111', 'LOGIN', 'PASSWORD'))
{
$arrID = $API->comm(
"/ppp/active/getall",
array(
".proplist"=> ".id",
"?name" => $username,
)
);
// This commad is not working
$API->comm(
"/ppp/secret/remove",
array(
".id" => $arrID[0][".id"],
)
);
$API->disconnect();
}