Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
1d82d93b
Commit
1d82d93b
authored
9 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
Implement getOwner for external share storage
parent
90bd53c9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/files_sharing/lib/external/storage.php
+6
-1
6 additions, 1 deletion
apps/files_sharing/lib/external/storage.php
with
6 additions
and
1 deletion
apps/files_sharing/lib/external/storage.php
+
6
−
1
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
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment