From fb8a1353d943e0ff5d48e4a1033da9edc182bc73 Mon Sep 17 00:00:00 2001 From: iBNu Maksum Date: Fri, 23 Aug 2019 16:15:02 +0700 Subject: [PATCH] Update login mikrotik untuk versi baru --- .gitignore | 3 ++- system/autoload/PEAR2/Net/RouterOS/Client.php | 14 ++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index aef7d02..eb691d3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .DS_Store .vscode/ ui/compiled/*.php -ui/cache/*.php \ No newline at end of file +ui/cache/*.php +/test.php \ No newline at end of file diff --git a/system/autoload/PEAR2/Net/RouterOS/Client.php b/system/autoload/PEAR2/Net/RouterOS/Client.php index cc1d136..1dd59ce 100644 --- a/system/autoload/PEAR2/Net/RouterOS/Client.php +++ b/system/autoload/PEAR2/Net/RouterOS/Client.php @@ -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