Commit Graph

52 Commits

Author SHA1 Message Date
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Christoph Wurst 734c62bee0
Format code according to PSR2
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:56:50 +02:00
Christoph Wurst 1584c9ae9c
Add visibility to all methods and position of static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:51:06 +02:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +02:00
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Georg Ehrke 52ba75f644
Sabre/DAV 4.0: beforeMethod is now beforeMethod:*
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-03-27 12:53:44 +01:00
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Arthur Schiwon 82f8a167a6
use core templates for displaying dav errors in the browser
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-03-20 22:39:22 +01:00
Arthur Schiwon b285e19dc8
fix dav browser error page not styled
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-03-19 23:44:14 +01:00
Roeland Jago Douma 73ce7f6c8a
Add offset for home limited searches
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-12-10 23:30:15 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Robin Appelman c62637da8b
Allow filtering the search results to the users home storage
This is done by adding a

```xml
<d:eq>
    <d:prop>
        <oc:owner-id/>
    </d:prop>
    <d:literal>$userId</d:literal>
</d:eq>
```

clause to the search query.

Searching by `owner-id` can only be done with the current user id
and the comparison can not be inside a `<d:not>` or `<d:or>` statement

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-12-03 13:49:37 +01:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Christian e2a64c713f
cast timestamps older than unix epoch to 0
This change solves issues #10870, which is caused by method castValue of class FileSearchBackend: It casts the timestamps older than the unix epoch to false., see my comment https://github.com/nextcloud/server/pull/10835#discussion_r212806153.
2018-08-27 07:44:24 +02:00
Robin Appelman b76e6be441 disallow negative mtime in dav search
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-08-24 16:20:07 +02:00
Robin Appelman 1f9f5e2e5e
Fix lazy search backend
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-07-02 13:42:41 +02:00
Robin Appelman b21bec5c73
Fix search related results in OPTIONS requests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-06-28 14:54:46 +02:00
Robin Appelman 51724a35a4
use getUserFolder instead of getFileInfo when constructing FilesHome
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-05-24 14:17:53 +02:00
Roeland Jago Douma c306bc29d1
Make displayname selectable
It is dav. so if it is not properly set we just return a 404 anyway.
2018-03-22 16:46:21 +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
Roeland Jago Douma c1ff12e234
CacheJail should apply limit and offset after searching
Else the results might not be correct.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-02-07 13:41:15 +01:00
Robin Appelman 6b5419ddf0
Adjust to updated searchdav library
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-02-07 13:41:15 +01:00
Roeland Jago Douma ec144281ef
Respect limit and order in webdav search
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-02-07 13:41:15 +01:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01: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
Roeland Jago Douma fc369dd86e
[DAV] Fix URLUtil::splitPath usage
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-08-01 08:20:17 +02:00
Morris Jobke b2c96d0c23 Stop if user folder is not available
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-05-09 11:26:08 -05:00
Robin Appelman bb7e236e74
Allow searching file by fileid
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-05 15:22:53 +02:00
Georg Ehrke 242bb746b9
OCA\DAV\Files\CustomPropertiesBackend -> OCA\DAV\DAV\CustomPropertiesBackend
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2017-03-27 19:15:51 +02:00
Georg Ehrke b887adf386
allow sharees to edit certain calendar properties for themselves
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2017-03-27 17:21:57 +02:00
Robin Appelman e392d02d80
safer casting of datetime
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-14 14:12:40 +01:00
Robin Appelman 6074dc9979
fix searching and ordering on getlastmodified
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-13 14:44:52 +01:00
Robin Appelman e61606a767
Allow searching for favorites
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-08 16:30:55 +01:00
Robin Appelman 709f64d396
add tests for filesearchbackend
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-01 14:06:40 +01:00
Robin Appelman df2063ee7b
Implement webdav SEARCH
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-01 14:06:39 +01:00
Robin Appelman 706131b394
add icewind/searchdav
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-02-28 14:24:18 +01:00
Thomas Müller 6345748a70
Fix "Call to a member function getUID() on null"
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-19 15:48:18 +01:00
Roeland Jago Douma 363963577c
Harden files drop
* Fail on MKCOL
* Only take filename ignore directories
* No need to parse query parameters

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-12-02 13:03:56 +01:00
Roeland Jago Douma 4b3b562c4f
Fixes files_drop for sabre 3.2
In the new sabre (3.2) the order of beforeMethod is switched. it used to
be that beforeMethod:METHOD was called after beforeMethod. But now it is
called before. Since we need the view this was broken.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-10 20:44:41 +01:00
Thomas Müller c778b1bade
Update sabre dav to 3.2 (#26115)
* Update sabre/dav to 3.2.0

* Adjust code to work with sabre/dav 3.2.0 and it's dependencies

* Adding own CalDAV plugin to fix calendar home property

* Test if there is a user logged in when listing files home

* Update sabre version used by integration tests

* Disable unauthenticated DAV access

This is needed to make Sabre 3.2 behave like we did before.
Eventually we should integrate better with the ACL plugin which itself
should implement an auth failure when appropriate.

=====

* Fixed so cherry-pick was succesfull

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-04 13:35:10 +01:00
Thomas Müller 726994ecae
Remove any detailed information about the exception in the browser error plugin 2016-10-25 14:47:33 +02:00
Roeland Jago Douma c8a13f644e
Only enable files_drop plugin when we actuall do files_drop
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-24 21:45:00 +02:00
Roeland Jago Douma 7a6dbeb398
Make files_drop work
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-24 21:45:00 +02:00
Roeland Jago Douma e73a11d106
Fix permision mask
If we move a file from the temp part file to the original file we don't
need update permissions.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-10-24 21:45:00 +02:00
Vincent Petry b17e836e45
FilesHome now also returns DAV properties
The files home node must also return DAV properties like etag,
permissions, etc for the clients to work like they did with the old
endpoint.

This fix makes FilesHome extend the Sabre Directory class, this makes
the FilesPlugin and other plugins recognize it as a directory and will
retrieve the matching properties when applicable.

Downstream of https://github.com/owncloud/core/pull/26066

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-09-26 11:24:23 +02:00
Lukas Reschke f715b5ea2e
Don't print exception message in HTML
The exception message is potentially influenced by user input and could thus be confusing (e.g. somebody could try to open a file like "Please send a mail to support@foo.com", and then the message would include that string.

It is thus reasonable to not show the exception message by default. Also for the browser view I added an `exit()` at the end, as otherwise the XML exception would be attached.
2016-09-09 13:52:34 +02:00
Joas Schilling 0215b004da
Update with robin 2016-07-21 18:13:58 +02:00
Joas Schilling 813f0a0f40
Fix apps/ 2016-07-21 18:13:57 +02:00
Robin Appelman f98cb9efa0
Fix type hinting 2016-07-08 12:35:50 +02:00