summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/sftp.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/sftp.php')
-rw-r--r--apps/files_external/lib/sftp.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php
index f6c56669734..2a762ad068f 100644
--- a/apps/files_external/lib/sftp.php
+++ b/apps/files_external/lib/sftp.php
@@ -20,7 +20,7 @@ class SFTP extends \OC\Files\Storage\Common {
/**
* @var \Net_SFTP
*/
- private $client;
+ protected $client;
private static $tempFiles = array();
@@ -42,7 +42,8 @@ class SFTP extends \OC\Files\Storage\Common {
$this->host = substr($this->host, $proto+3);
}
$this->user = $params['user'];
- $this->password = $params['password'];
+ $this->password
+ = isset($params['password']) ? $params['password'] : '';
$this->root
= isset($params['root']) ? $this->cleanPath($params['root']) : '/';
@@ -101,6 +102,18 @@ class SFTP extends \OC\Files\Storage\Common {
return 'sftp::' . $this->user . '@' . $this->host . '/' . $this->root;
}
+ public function getHost() {
+ return $this->host;
+ }
+
+ public function getRoot() {
+ return $this->root;
+ }
+
+ public function getUser() {
+ return $this->user;
+ }
+
/**
* @param string $path
*/
@@ -121,7 +134,7 @@ class SFTP extends \OC\Files\Storage\Common {
return false;
}
- private function writeHostKeys($keys) {
+ protected function writeHostKeys($keys) {
try {
$keyPath = $this->hostKeysPath();
if ($keyPath && file_exists($keyPath)) {
@@ -137,7 +150,7 @@ class SFTP extends \OC\Files\Storage\Common {
return false;
}
- private function readHostKeys() {
+ protected function readHostKeys() {
try {
$keyPath = $this->hostKeysPath();
if (file_exists($keyPath)) {