Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
cd4e044f
Commit
cd4e044f
authored
11 years ago
by
Björn Schießle
Browse files
Options
Downloads
Patches
Plain Diff
public upload is also possible with encryption enabled, since OC6
parent
75c8d74c
No related branches found
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/api.php
+4
-10
4 additions, 10 deletions
apps/files_sharing/lib/api.php
with
4 additions
and
10 deletions
apps/files_sharing/lib/api.php
+
4
−
10
View file @
cd4e044f
...
...
@@ -220,9 +220,7 @@ class Api {
$shareWith
=
isset
(
$_POST
[
'password'
])
?
$_POST
[
'password'
]
:
null
;
//check public link share
$publicUploadEnabled
=
\OC_Appconfig
::
getValue
(
'core'
,
'shareapi_allow_public_upload'
,
'yes'
);
$encryptionEnabled
=
\OC_App
::
isEnabled
(
'files_encryption'
);
if
(
isset
(
$_POST
[
'publicUpload'
])
&&
(
$encryptionEnabled
||
$publicUploadEnabled
!==
'yes'
))
{
if
(
isset
(
$_POST
[
'publicUpload'
])
&&
$publicUploadEnabled
!==
'yes'
)
{
return
new
\OC_OCS_Result
(
null
,
403
,
"public upload disabled by the administrator"
);
}
$publicUpload
=
isset
(
$_POST
[
'publicUpload'
])
?
$_POST
[
'publicUpload'
]
:
'false'
;
...
...
@@ -321,11 +319,8 @@ class Api {
$permissions
=
isset
(
$params
[
'_put'
][
'permissions'
])
?
(
int
)
$params
[
'_put'
][
'permissions'
]
:
null
;
$publicUploadStatus
=
\OC_Appconfig
::
getValue
(
'core'
,
'shareapi_allow_public_upload'
,
'yes'
);
$encryptionEnabled
=
\OC_App
::
isEnabled
(
'files_encryption'
);
$publicUploadEnabled
=
false
;
if
(
!
$encryptionEnabled
&&
$publicUploadStatus
===
'yes'
)
{
$publicUploadEnabled
=
true
;
}
$publicUploadEnabled
=
(
$publicUploadStatus
===
'yes'
)
?
true
:
false
;
// only change permissions for public shares if public upload is enabled
// and we want to set permissions to 1 (read only) or 7 (allow upload)
...
...
@@ -363,8 +358,7 @@ class Api {
private
static
function
updatePublicUpload
(
$share
,
$params
)
{
$publicUploadEnabled
=
\OC_Appconfig
::
getValue
(
'core'
,
'shareapi_allow_public_upload'
,
'yes'
);
$encryptionEnabled
=
\OC_App
::
isEnabled
(
'files_encryption'
);
if
(
$encryptionEnabled
||
$publicUploadEnabled
!==
'yes'
)
{
if
(
$publicUploadEnabled
!==
'yes'
)
{
return
new
\OC_OCS_Result
(
null
,
403
,
"public upload disabled by the administrator"
);
}
...
...
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