From 8bab0d8735603683ea7ba18a2248257368ece16f Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Wed, 18 Jun 2014 15:59:38 +0200 Subject: Fix send_command() in telnet. --- auth/telnet.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/auth/telnet.php b/auth/telnet.php index f490148..628e602 100644 --- a/auth/telnet.php +++ b/auth/telnet.php @@ -42,8 +42,8 @@ final class Telnet extends Authentication { throw new Exception('Cannot connect to router.'); } - fputs($this->connection, $this->config['user']."\r"); - fputs($this->connection, $this->config['pass']."\r"); + fputs($this->connection, $this->config['user']."\r\n"); + fputs($this->connection, $this->config['pass']."\r\n"); } public function send_command($command) { @@ -51,6 +51,8 @@ final class Telnet extends Authentication { $this->connect(); } + fputs($this->connection, $command."\r\n"); + $data = ''; while(!feof(!$this->connection)) { $data .= fread($this->connection, 4096); -- cgit v1.2.3