I'm trying to create a PHP code that can change a user password using PHP API, here is my code so far:
<?php
require('routeros_api.class.php');
$API = new routerosAPI();
$API->debug = true;
if ($API->connect('192.168.0.101', 'user', 'password')) {
$API->write('/tool/user-manager/user/getall', false);
$API->write('=.proplist=username', false);
$API->write('?username=john');
$API->write('/tool/user-manager/user/set',false);
$API->write('password=4321');
$READ = $API->read(false);
$ARRAY = $API->parseResponse($READ);
print_r($ARRAY);
$API->disconnect();
}
?>
When I run this code it appears to only return the username I'm searching but the password doesn't change. Any help?