summaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/icewind/smb/src/Server.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/3rdparty/icewind/smb/src/Server.php')
-rw-r--r--apps/files_external/3rdparty/icewind/smb/src/Server.php29
1 files changed, 4 insertions, 25 deletions
diff --git a/apps/files_external/3rdparty/icewind/smb/src/Server.php b/apps/files_external/3rdparty/icewind/smb/src/Server.php
index 25f17201397..12692eb4c6e 100644
--- a/apps/files_external/3rdparty/icewind/smb/src/Server.php
+++ b/apps/files_external/3rdparty/icewind/smb/src/Server.php
@@ -135,32 +135,11 @@ class Server {
$connection = new RawConnection($command);
$connection->writeAuthentication($this->getUser(), $this->getPassword());
$output = $connection->readAll();
+ $parser = new Parser($this->timezoneProvider);
- $line = $output[0];
+ $parser->checkConnectionError($output[0]);
- $line = rtrim($line, ')');
- if (substr($line, -23) === ErrorCodes::LogonFailure) {
- throw new AuthenticationException();
- }
- if (substr($line, -26) === ErrorCodes::BadHostName) {
- throw new InvalidHostException();
- }
- if (substr($line, -22) === ErrorCodes::Unsuccessful) {
- throw new InvalidHostException();
- }
- if (substr($line, -28) === ErrorCodes::ConnectionRefused) {
- throw new InvalidHostException();
- }
-
- $shareNames = array();
- foreach ($output as $line) {
- if (strpos($line, '|')) {
- list($type, $name, $description) = explode('|', $line);
- if (strtolower($type) === 'disk') {
- $shareNames[$name] = $description;
- }
- }
- }
+ $shareNames = $parser->parseListShares($output);
$shares = array();
foreach ($shareNames as $name => $description) {
@@ -174,7 +153,7 @@ class Server {
* @return \Icewind\SMB\IShare
*/
public function getShare($name) {
- return new Share($this, $name);
+ return new Share($this, $name, $this->system);
}
/**