Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
1d82d93b
Commit
1d82d93b
authored
Nov 18, 2015
by
Robin Appelman
Browse files
Implement getOwner for external share storage
parent
90bd53c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
apps/files_sharing/lib/external/storage.php
View file @
1d82d93b
...
...
@@ -250,7 +250,7 @@ class Storage extends DAV implements ISharedStorage {
$response
=
$client
->
post
(
$url
,
[
'body'
=>
[
'password'
=>
$password
]]);
}
catch
(
\
GuzzleHttp\Exception\RequestException
$e
)
{
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
// in the UI in case the failure is intermittent, and the user will
...
...
@@ -260,4 +260,9 @@ class Storage extends DAV implements ISharedStorage {
return
json_decode
(
$response
->
getBody
(),
true
);
}
public
function
getOwner
(
$path
)
{
list
(,
$remote
)
=
explode
(
'://'
,
$this
->
remote
,
2
);
return
$this
->
remoteUser
.
'@'
.
$remote
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment