summaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/icewind/smb/src/Server.php
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2016-12-14 16:22:33 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-01-05 09:16:03 +0100
commit84296877888ff901c1bc5a9264d44ffb915e7c56 (patch)
treece62009cd10f98987606921ec3945160c0de1634 /apps/files_external/3rdparty/icewind/smb/src/Server.php
parent6a0f0403d01dc6a889157b446edef73f9af58540 (diff)
downloadnextcloud-server-84296877888ff901c1bc5a9264d44ffb915e7c56.tar.gz
nextcloud-server-84296877888ff901c1bc5a9264d44ffb915e7c56.zip
Update icewind/smb to 2.0.0
Signed-off-by: Robin Appelman <robin@icewind.nl>
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);
}
/**