Commit Graph

174 Commits

Author SHA1 Message Date
Morris Jobke 7cb467b476
Merge pull request #9355 from nextcloud/dav-upload-lock
only allow a single concurrent dav write to a file
2018-05-03 16:28:39 +02:00
Morris Jobke a56ec1062a
Merge pull request #9346 from nextcloud/techdep/noid/needsPartFile_to_storage
Use an actual function of the storage to determine needsPartFile
2018-05-02 16:03:31 +02:00
Roeland Jago Douma 953691abb2
External mount does not get DELETE and UPDATE if readonly
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-01 15:18:56 +02:00
Roeland Jago Douma 055a003661
Use an actual function of the storage to determine needsPartFile
We have a function for it so better to override that. Also because other
codes that might check this should get the right value.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-01 15:02:36 +02:00
Robin Appelman dd1b0799a4
only allow a single concurrent dav write to a file
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-04-26 11:16:51 +02:00
Arthur Schiwon 38a90130ce
move log constants to ILogger
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-04-26 10:45:52 +02:00
Morris Jobke dd34cb7540
Less deprecated calls to OCP\Util::writeLog
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-04-22 20:41:49 +02:00
Robin Appelman bc3fde9f75
log more information about insufficient storage in dav plugin
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-04-17 15:29:37 +02:00
Robin Appelman e6a7ddc1c6 transform exception during file read to sabre exceptions
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-04-11 14:45:35 +02:00
Morris Jobke bd8352d4c4
Merge pull request #8996 from brandonkirsch/fix-onenote-dav
Fix webdav support for OneNote clients
2018-04-03 13:27:29 +02:00
Roeland Jago Douma e8b7e9e75d
Do not treat is-encrypted as customer property
fixes #8977

Else for all files in a folder we would launch off more queries.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-28 08:34:50 +02:00
Brandon Kirsch c5005bbab5 Fix webdav support for OneNote clients 2018-03-26 15:32:12 -04:00
Roeland Jago Douma e6a2c13ac1
MethodNotAllowed is not a Fatal error
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-26 12:15:31 +02:00
Robin Appelman f5ef9e02b2
emit pre-hooks earlier when not using part files
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-03-08 13:02:35 +01:00
Morris Jobke 236086c457
Merge pull request #8335 from nextcloud/remove-unused-import
Remove unused import statements
2018-02-14 22:23:07 +01:00
Morris Jobke d3d045dd5c
Remove unused import statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-02-14 16:55:43 +01:00
Morris Jobke e2974f1133
Simplify return statement
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-02-13 21:55:24 +01:00
Robin Appelman 9d6d23d1f7
keep previous exception when transforming to dav exception
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-02-07 13:34:30 +01:00
Roeland Jago Douma 9896b15ec8
Only handle encrypted property on folders
Exposing the encrypted property is required for E2E. However, there is
no need to expose this on files as then it is server side encryption
(which the clients don't care about).

Better to not confuse the output.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-01-30 12:25:49 +01:00
Morris Jobke eb51f06a3b
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-29 12:03:47 +01:00
Morris Jobke c005fc6755
Cleanup unused code
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 15:25:19 +01:00
Morris Jobke c1e4f9f305
Use type casting instead of *val() method
It should be up to 6x faster

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 11:35:42 +01:00
Morris Jobke 0a56d2185e
Return value immediately instead of assigning to a one-time variable
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 00:02:03 +01:00
blizzz c7d9e5fd63
Merge pull request #7354 from nextcloud/refacor-update-page-print
Refactor method to check if update is needed
2018-01-22 22:50:05 +01:00
Morris Jobke 876238ce8b
Merge pull request #7533 from nextcloud/oc-28545-handle-oc-total-length-in-new-chunking
[oc] Handle OC-Total-Length in new chunking
2018-01-03 16:18:24 +01:00
Morris Jobke 0b4d18673e
Do not log user errors as log level 4
* hides log entries for the case the parent folder does not exist

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-03 11:58:55 +01:00
Thomas Müller 8c5d656f3b Handle OC-Total-Length in new chunking
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-12-15 14:46:36 +01:00
Georg Ehrke 6802e2b59a
Principal search: Take sharing settings into account
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2017-12-11 16:04:55 +01:00
Christoph Seitz 787e3d51b4
Fix functions to search for principals in the backend.
Add a "searchPrincipals" function to the NC principal backend.
Fix the "findByUri" function to respect the prefixPath.

Signed-off-by: Christoph Seitz <christoph.seitz@posteo.de>
2017-12-11 16:04:55 +01:00
Morris Jobke 5b20600da9
Merge pull request #7313 from nextcloud/ensure-that-x-oc-mtime-header-is-an-integer-with-chunked-uploads
Ensure that X-OC-MTime header is an integer with chunked uploads
2017-12-11 15:07:05 +01:00
Roeland Jago Douma d2fe30d464
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-12-04 15:23:20 +01:00
Roeland Jago Douma c8a29ec942
A failed storage is a not available storage
We have to double check. Since getting the info of the root returns a
generic entry. But actually the stroage is not available. Else we get
very weird sync and web behavior.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-12-04 15:23:11 +01:00
Morris Jobke f22e02cd79
Refactor method to check if update is needed
There was only one call, that actually needed the parameter to be set to true. So this change moved the print of the page to that location and replaces all other occurences with a direct call to the underlying OCP API.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-30 16:04:07 +01:00
Daniel Calviño Sánchez 2a7b1bae10 Reject X-OC-MTime header if given as a string with hexadecimal notation
In PHP 7.X hexadecimal notation support was removed from "is_numeric",
so "sanitizeMtime" directly rejected those values; in PHP 5.X, on the
other hand, "sanitizeMtime" returned 0 when a string with hexadecimal
notation was given (as it was the behaviour of "intval"). To provide a
consistent behaviour between PHP versions, and given that it does not
make much sense to send X-OC-MTime in hexadecimal notation, now
X-OC-MTime is always rejected if given as a string with hexadecimal
notation.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-11-28 01:08:52 +01:00
Thomas Müller ffe034abb0 Don't use runInSeparateProcess
Directly calling "header" in the PHPUnit process causes the "Cannot
modify header information - headers already sent by" error to be thrown.
Instead of running the test in a separate process, which is slower, this
commit wraps the call to "header" in a method that can be mocked in the
tests.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-11-27 20:39:45 +01:00
Daniel Calviño Sánchez 2af3d8a9b2 Make possible to provide a specific HTTP request object to File
This will be used in a following commit to test how the X-OC-MTime
header is handled.

This commit is based on the "make File::put() more testable" commit
(included in 018d45cad97e0) from ownCloud by Artur Neumann.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-11-27 20:39:41 +01:00
Daniel Calviño Sánchez 01e346b2ae Ensure that X-OC-MTime header is an integer also with chunked uploads
This commit extends the changes introduced in pull request #3793 also to
chunked uploads.

The "sanitizeMTime" method name is the same used in the equivalent pull
request to this one from ownCloud (28066).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-11-27 20:37:51 +01:00
Morris Jobke 573551253e
Merge pull request #7308 from nextcloud/do-not-log-InvalidSyncToken
Log InvalidSyncToken on DAV in debug level
2017-11-27 17:27:41 +01:00
Morris Jobke 88905c6293
Log InvalidSyncToken on DAV in debug level
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-27 16:37:11 +01:00
Morris Jobke 26a5fff423
Log NotImplementedException on DAV in debug level
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-27 16:17:01 +01:00
Björn Schießle f347e2e4a6
Merge pull request #7047 from nextcloud/add-support-for-files-with-no-permissions
Add support for files with no permissions
2017-11-20 16:15:52 +01:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Daniel Calviño Sánchez 555d582f35 Return whether the file is readable or not in the DAV permissions
Until now it was safe to assume that every file was readable by its
owner, so there was no need to return whether the file was readable or
not. However, with the introduction of end to end encryption that is no
longer the case, and it is now necessary to explicitly provide that
information.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-11-02 19:37:00 +01:00
Joas Schilling 7c53f921a9
Use ::class to avoid errors
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-10-13 12:36:20 +02:00
Joas Schilling fd5465d509
Fix class name, regression from 44cf67accd
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-10-13 12:35:52 +02:00
Roeland Jago Douma ab63c89ab3
Fix quota calculation on new dav upload endpoint
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-09-13 19:28:38 +02:00
Morris Jobke 1724fed8c5 Merge pull request #5415 from nextcloud/search-cache-node
cache nodes from search results
2017-09-06 10:16:01 +02:00
Bjoern Schiessle e83e1c7c23
add propfind to detect encryption status
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-08-28 14:02:25 +02:00
Robin Appelman 37e8b698f7 cache nodes from search results
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-08-26 10:18:19 +02:00
Morris Jobke fc12bd0be6 Do not log WebDAV maintenance mode exception
Log the maintenance mode exception only in debug level. Fixes #6124

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-08-15 15:03:39 +02:00