Net_RouterOS
Net_RouterOS copied to clipboard
Login doesn't work on 6.43
Hello,
I've upgraded to version 6.43rc5 only to find out the API login doesn't work as they've changed the way you're supposed to login.
Can I please get a quick tip on how to modify it so I can use the latest update?
I haven't looked at the code yet, but I think the fix should be similar to what I've done in perl's library/ Maybe this will help: https://github.com/martin8883/MikroTik-API/pull/4/files
#37 Same issue
I have a solution to resolve this problem: Change function to the new code in Client.php file below:
private static function _login(
Communicator $com,
$username,
$password = '',
$timeout = null
) {
$request = new Request('/login');
$request->setArgument('name', $username);
$request->setArgument('password', $password);
$request->send($com);
$response = new Response($com, false, $timeout);
return $response->getType() === Response::TYPE_FINAL;
}