summaryrefslogtreecommitdiff
path: root/auth/telnet.php
diff options
context:
space:
mode:
authorGuillaume Mazoyer <respawneral@gmail.com>2014-08-03 23:55:08 +0200
committerGuillaume Mazoyer <respawneral@gmail.com>2014-08-03 23:55:08 +0200
commit5b6dbececd1c158e8fdb1c2458a2be5528ad38b8 (patch)
tree93518bce2a6ef1d5d6ce04f44315e0e74755bbf1 /auth/telnet.php
parentb26e4808e59cd499ead2c42f74bf94ca8f434718 (diff)
Be sure to login and disconnect after each command.
Diffstat (limited to 'auth/telnet.php')
-rw-r--r--auth/telnet.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/auth/telnet.php b/auth/telnet.php
index 628e602..40a8822 100644
--- a/auth/telnet.php
+++ b/auth/telnet.php
@@ -47,9 +47,7 @@ final class Telnet extends Authentication {
}
public function send_command($command) {
- if ($this->connection == null) {
- $this->connect();
- }
+ $this->connect();
fputs($this->connection, $command."\r\n");
@@ -58,6 +56,8 @@ final class Telnet extends Authentication {
$data .= fread($this->connection, 4096);
}
+ $this->disconnect();
+
return $data;
}