我正在构建一个带有用户配置文件编辑和访客凭据等的 WiFi 身份验证工具。
我可以将用户写入 mikrotik 并毫无问题地删除用户,但我找不到任何有关编辑用户配置文件的文档。我想我可以删除它并添加一条新记录,但这只是效率低下,并且可能会在用户键下产生问题。
我正在使用class.routeros_api.php并且我使用的是 6.30 版
添加用户是这样完成的......
$response = $api->comm("/tool/user-manager/user/add",array(
"customer" => "admin",
"username" => "guest_user",
"location" => "Guest",
"first-name" => "Guest",
"last-name" => "1",
"password" => "somepw",
"shared-users" => "1",
"copy-from" => "00:00:00:00:00:00"
));
删除用户...
$response = $api->comm("/tool/user-manager/user/remove",array(
".id" => "*15"
));
所以我认为编辑用户会像......
$response = $api->comm("/tool/user-manager/user/edit",array(
".id" => "*15",
"username" => "someotheruser",
"password" => "someotherpass"
));
但是,我收到的错误是......
<<< [28] /tool/user-manager/user/edit
<<< [8] =.id=*14
<<< [14] =username=someotheruser
<<< [19] =password=someotherpass
>>> [5/5] bytes read.
>>> [5, 35]!trap
>>> [26/26] bytes read.
>>> [26, 8]=message=unknown parameter
>>> [5/5] bytes read.
>>> [5, 1]!done
如果有人以前这样做过并且可以帮助“/tool/user-manager/user/edit”命令的适当语法,我们将不胜感激。