Changeset 942 for trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php
- Timestamp:
- Aug 26, 2022, 11:04:38 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php
r915 r942 56 56 $IP = 'ssl://'.$IP; 57 57 } 58 $this->Socket = @fsockopen($IP, $this->Port, $this->ErrorNo, $this->ErrorStr, $this->Timeout); 59 if ($this->Socket) 60 { 61 socket_set_timeout($this->Socket, $this->Timeout); 62 $this->Write('/login', false); 63 $this->Write('=name=' . $Login, false); 64 $this->Write('=password='.$Password); 65 $Response = $this->Read(false); 66 if ((count($Response) > 0) and ($Response[0] == '!done')) $this->Connected = true; 67 if (!$this->Connected) fclose($this->Socket); 58 try 59 { 60 $LastErrorReporting = error_reporting(); 61 error_reporting(0); 62 63 $this->Socket = @fsockopen($IP, $this->Port, $this->ErrorNo, $this->ErrorStr, $this->Timeout); 64 if ($this->Socket) 65 { 66 socket_set_timeout($this->Socket, $this->Timeout); 67 $this->Write('/login', false); 68 $this->Write('=name=' . $Login, false); 69 $this->Write('=password='.$Password); 70 $Response = $this->Read(false); 71 if ((count($Response) > 0) and ($Response[0] == '!done')) $this->Connected = true; 72 if (!$this->Connected) fclose($this->Socket); 73 } 74 } finally 75 { 76 error_reporting($LastErrorReporting); 68 77 } 69 78 }
Note:
See TracChangeset
for help on using the changeset viewer.