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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
a2848ee1
Commit
a2848ee1
authored
May 7, 2014
by
Björn Schießle
Browse files
Options
Downloads
Plain Diff
Merge pull request #8497 from owncloud/sharing_cleanup
[sharing] some small clean ups and bug fixes
parents
254fa5eb
f85e9688
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/files_sharing/lib/helper.php
+1
-1
1 addition, 1 deletion
apps/files_sharing/lib/helper.php
apps/files_sharing/lib/sharedstorage.php
+6
-20
6 additions, 20 deletions
apps/files_sharing/lib/sharedstorage.php
apps/files_sharing/lib/updater.php
+2
-3
2 additions, 3 deletions
apps/files_sharing/lib/updater.php
with
9 additions
and
24 deletions
apps/files_sharing/lib/helper.php
+
1
−
1
View file @
a2848ee1
...
...
@@ -125,7 +125,7 @@ class Helper {
$ids
=
array
();
while
(
$path
!==
''
&&
$path
!==
'.'
&&
$path
!==
'/'
)
{
while
(
$path
!==
dirname
(
$path
)
)
{
$info
=
$ownerView
->
getFileInfo
(
$path
);
if
(
$info
instanceof
\OC\Files\FileInfo
)
{
$ids
[]
=
$info
[
'fileid'
];
...
...
This diff is collapsed.
Click to expand it.
apps/files_sharing/lib/sharedstorage.php
+
6
−
20
View file @
a2848ee1
...
...
@@ -102,14 +102,15 @@ class Shared extends \OC\Files\Storage\Common {
/**
* @brief Get the permissions granted for a shared file
* @param string Shared target file path
* @return int CRUDS permissions granted
or false if not found
* @return int CRUDS permissions granted
*/
public
function
getPermissions
(
$target
)
{
$source
=
$this
->
getFile
(
$target
);
if
(
$source
)
{
return
$source
[
'permissions'
];
$permissions
=
$this
->
share
[
'permissions'
];
// part file are always have delete permissions
if
(
pathinfo
(
$target
,
PATHINFO_EXTENSION
)
===
'part'
)
{
$permissions
|=
\OCP\PERMISSION_DELETE
;
}
return
false
;
return
$permissions
;
}
public
function
mkdir
(
$path
)
{
...
...
@@ -183,9 +184,6 @@ class Shared extends \OC\Files\Storage\Common {
}
public
function
isCreatable
(
$path
)
{
if
(
$path
==
''
)
{
$path
=
$this
->
getMountPoint
();
}
return
(
$this
->
getPermissions
(
$path
)
&
\OCP\PERMISSION_CREATE
);
}
...
...
@@ -194,23 +192,14 @@ class Shared extends \OC\Files\Storage\Common {
}
public
function
isUpdatable
(
$path
)
{
if
(
$path
==
''
)
{
$path
=
$this
->
getMountPoint
();
}
return
(
$this
->
getPermissions
(
$path
)
&
\OCP\PERMISSION_UPDATE
);
}
public
function
isDeletable
(
$path
)
{
if
(
$path
==
''
)
{
$path
=
$this
->
getMountPoint
();
}
return
(
$this
->
getPermissions
(
$path
)
&
\OCP\PERMISSION_DELETE
);
}
public
function
isSharable
(
$path
)
{
if
(
$path
==
''
)
{
$path
=
$this
->
getMountPoint
();
}
return
(
$this
->
getPermissions
(
$path
)
&
\OCP\PERMISSION_SHARE
);
}
...
...
@@ -454,9 +443,6 @@ class Shared extends \OC\Files\Storage\Common {
}
public
function
free_space
(
$path
)
{
if
(
$path
==
''
)
{
$path
=
$this
->
getMountPoint
();
}
$source
=
$this
->
getSourcePath
(
$path
);
if
(
$source
)
{
list
(
$storage
,
$internalPath
)
=
\OC\Files\Filesystem
::
resolvePath
(
$source
);
...
...
This diff is collapsed.
Click to expand it.
apps/files_sharing/lib/updater.php
+
2
−
3
View file @
a2848ee1
...
...
@@ -38,14 +38,13 @@ class Shared_Updater {
\OC\Files\Filesystem
::
initMountPoints
(
$user
);
$view
=
new
\OC\Files\View
(
'/'
.
$user
);
if
(
$view
->
file_exists
(
$path
))
{
while
(
$path
!==
'/'
)
{
while
(
$path
!==
dirname
(
$path
)
)
{
$etag
=
$view
->
getETag
(
$path
);
$view
->
putFileInfo
(
$path
,
array
(
'etag'
=>
$etag
));
$path
=
dirname
(
$path
);
}
}
else
{
error_log
(
"error!"
.
'can not update etags on '
.
$path
.
' for user '
.
$user
);
\OCP\Util
::
writeLog
(
'files_sharing'
,
'can not update etags on '
.
$path
.
' for user '
.
$user
,
\OCP\Util
::
ERROR
);
\OCP\Util
::
writeLog
(
'files_sharing'
,
'can not update etags on '
.
$path
.
' for user '
.
$user
.
'. Path does not exists'
,
\OCP\Util
::
DEBUG
);
}
}
...
...
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
sign in
to comment