Hi
I am using the PHP API to do a variety of things on Router OS. However one thing I need to be able to do is change a password for an existing user.
The command I want to execute is "/user set username password=“password”
I can’t for the life of me work out the syntax to use in the API. Can anyone assist?
thanks
The second example at the wiki shows just that, although for hotspot users. The key part is:
$setRequest = new RouterOS\Request('/ip hotspot user set');
$client($setRequest
->setArgument('numbers', $hotspotUsername)
->setArgument('password', $_POST['password'])
);
It should be the same deal for RouterOS users, i.e.
$setRequest = new RouterOS\Request('/user set');
$client($setRequest
->setArgument('numbers', 'admin')
->setArgument('password', $_POST['password'])
);