Changeset 861 for trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php
- Timestamp:
- Oct 2, 2019, 12:15:16 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php
r738 r861 54 54 { 55 55 socket_set_timeout($this->Socket, $this->Timeout); 56 $this->Write('/login'); 56 $this->Write('/login', false); 57 $this->Write('=name=' . $Login, false); 58 $this->Write('=password='.$Password); 57 59 $Response = $this->Read(false); 58 if ((count($Response) > 1) and ($Response[0] == '!done')) { 59 if (preg_match_all('/[^=]+/i', $Response[1], $Matches)) { 60 if ($Matches[0][0] == 'ret' && strlen($Matches[0][1]) == 32) { 61 $this->Write('/login', false); 62 $this->Write('=name=' . $Login, false); 63 $this->Write('=response=00'.md5(chr(0).$Password.pack('H*', $Matches[0][1]))); 64 $Response = $this->Read(false); 65 if((count($Response) > 0) and ($Response[0] == '!done')) $this->Connected = true; 66 } 67 } 68 } 60 if((count($Response) > 0) and ($Response[0] == '!done')) $this->Connected = true; 69 61 if(!$this->Connected) fclose($this->Socket); 70 62 }
Note:
See TracChangeset
for help on using the changeset viewer.