Commit 1d82d93b authored by Robin Appelman's avatar Robin Appelman
Browse files

Implement getOwner for external share storage

parent 90bd53c9
...@@ -250,7 +250,7 @@ class Storage extends DAV implements ISharedStorage { ...@@ -250,7 +250,7 @@ class Storage extends DAV implements ISharedStorage {
$response = $client->post($url, ['body' => ['password' => $password]]); $response = $client->post($url, ['body' => ['password' => $password]]);
} catch (\GuzzleHttp\Exception\RequestException $e) { } catch (\GuzzleHttp\Exception\RequestException $e) {
if ($e->getCode() === 401 || $e->getCode() === 403) { if ($e->getCode() === 401 || $e->getCode() === 403) {
throw new ForbiddenException(); throw new ForbiddenException();
} }
// throw this to be on the safe side: the share will still be visible // throw this to be on the safe side: the share will still be visible
// in the UI in case the failure is intermittent, and the user will // in the UI in case the failure is intermittent, and the user will
...@@ -260,4 +260,9 @@ class Storage extends DAV implements ISharedStorage { ...@@ -260,4 +260,9 @@ class Storage extends DAV implements ISharedStorage {
return json_decode($response->getBody(), true); return json_decode($response->getBody(), true);
} }
public function getOwner($path) {
list(, $remote) = explode('://', $this->remote, 2);
return $this->remoteUser . '@' . $remote;
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment