From 54d90d296b1619c9397c12a831f9b6cb46560510 Mon Sep 17 00:00:00 2001 From: Mhamad Rachini Date: Tue, 20 Oct 2020 17:31:44 +0300 Subject: [PATCH] new login api --- src/PEAR2/Net/RouterOS/Client.php | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/PEAR2/Net/RouterOS/Client.php b/src/PEAR2/Net/RouterOS/Client.php index 08bdf63..25fd0d0 100644 --- a/src/PEAR2/Net/RouterOS/Client.php +++ b/src/PEAR2/Net/RouterOS/Client.php @@ -1,9 +1,10 @@ * @copyright 2011 Vasil Rangelov * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 - * @version GIT: $Id$ + * @version 1.0.0b6 * @link http://pear2.php.net/PEAR2_Net_RouterOS */ /** @@ -231,7 +232,7 @@ public static function login( $username, $password = '', $timeout = null - ) { + ) {/* if (null !== ($remoteCharset = $com->getCharset($com::CHARSET_REMOTE)) && null !== ($localCharset = $com->getCharset($com::CHARSET_LOCAL)) ) { @@ -240,7 +241,7 @@ public static function login( $remoteCharset . '//IGNORE//TRANSLIT', $password ); - } + }*/ $old = null; try { if ($com->getTransmitter()->isPersistent()) { @@ -286,16 +287,10 @@ private static function _login( $timeout = null ) { $request = new Request('/login'); - $request->send($com); - $response = new Response($com, false, $timeout); + //$request->send($com); + //$response = new Response($com, false, $timeout); $request->setArgument('name', $username); - $request->setArgument( - 'response', - '00' . md5( - chr(0) . $password - . pack('H*', $response->getProperty('ret')) - ) - ); + $request->setArgument('password', $password); $request->verify($com)->send($com); $response = new Response($com, false, $timeout);