Update login mikrotik untuk versi baru

This commit is contained in:
iBNu Maksum 2019-08-23 16:15:02 +07:00
parent 36043b3a36
commit fb8a1353d9
2 changed files with 6 additions and 11 deletions

3
.gitignore vendored
View file

@ -2,4 +2,5 @@
.DS_Store
.vscode/
ui/compiled/*.php
ui/cache/*.php
ui/cache/*.php
/test.php

View file

@ -131,7 +131,7 @@ class Client
$password = '',
$port = 8728,
$persist = false,
$timeout = null,
$timeout = 10,
$crypto = N::CRYPTO_OFF,
$context = null
) {
@ -274,16 +274,10 @@ class Client
$timeout = null
) {
$request = new Request('/login');
$request->send($com);
$response = new Response($com, false, $timeout);
// Update Mikrotik Versi terbaru
// sayangnya ini ngga aman, bagusnya di setup ke port SSL
$request->setArgument('name', $username);
$request->setArgument(
'response',
'00' . md5(
chr(0) . $password
. pack('H*', $response->getProperty('ret'))
)
);
$request->setArgument('password', $password);
$request->send($com);
$response = new Response($com, false, $timeout);
return $response->getType() === Response::TYPE_FINAL