Commit Graph

398 Commits

Author SHA1 Message Date
Julius Härtl 37b161b526 Remove trash items from other trash backends when deleting all
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-03-10 08:05:03 +00:00
Roeland Jago Douma 2f0948ed15 Do not obtain userFolder of a federated user
Federated shares are somewhat special. So we can't move the files from
the main user and we should try to get it from the intialized root
already.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-01-22 13:40:10 +00:00
Julius Härtl 59e60a0756
Only attempt to move to trash if a file is not in appdata
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-01 22:02:43 +01:00
Julius Härtl 1a607b2030
Delete files that exceed trashbin size immediately
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-23 09:09:39 +01:00
Julius Härtl ea23f0d920 Restrict query when searching for versions of trashbin files
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-11-04 07:32:53 +00:00
Robin Appelman f6bf519e55
dont hold a transaction during the move to trash
because moving to trash can take a long time, keeping a transaction active for the duration can lead to issues

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-10-05 15:27:31 +02:00
Daniel Kesselberg 0a5045ec8e Change free space calculation
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-09-03 07:33:20 +00:00
Morris Jobke d7aa1c00ed
Merge pull request #21983 from nextcloud/backport/21628/stable19
[stable19] fix moving files from external storage to object store trashbin
2020-08-19 21:29:01 +02:00
Robin Appelman 193b3ead51
fix object store trashbin handling
object stores are "special" given how they interact with the cache on their own

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-31 17:21:28 +02:00
Robin Appelman b6a600e653 rollback cache rename if trashbin move fails
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-23 21:01:23 +00:00
Robin Appelman c567b1d6b2 fix moving files from external storage to object store trashbin
having the "cache rename" after the "storage move" caused the target
to get the fileid from the source file, without taking care that the object
is stored under the original file id.

By doing the "cache rename" first, we trigger the "update existing file"
logic while moving the file to the object store and the object gets stored for the
correct file id

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-23 21:01:22 +00:00
Robin Appelman 38db847164 allow admin to configure the max trashbin size
this allows an admin to configure the max trashbin size instead of always relying on the users quota.

The trashbin size can be configured using the `occ trash:size` command and can be set both globally and per-user

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-23 14:30:07 +00:00
Robin Appelman 614acc9419
add locking to resolve concurent move to trashbin conflicts
uses a lock to prevent two requests from moving a file to the trashbin concurrently
(causing sql duplicate key errors)

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-06 20:36:55 +02:00
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 28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:54:27 +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 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +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 41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +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
Christoph Wurst 463b388589
Merge pull request #20170 from nextcloud/techdebt/remove-unused-imports
Remove unused imports
2020-03-27 17:14:08 +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
Christoph Wurst 74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:08:08 +01:00
Christoph Wurst 6127c288e8 Fix license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-01-13 14:23:49 +01:00
simonspa b3ad27f7db Trash bin: fix exception triggered if no correct fileId is provided.
This fixes #17115

Signed-off-by: Simon Spannagel <simon.spannagel@cern.ch>
2020-01-07 23:47:07 +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
Georg Ehrke c3748cfee3
respect shareapi_allow_share_dialog_user_enumeration in Principal backend for Sabre/DAV
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2019-12-03 09:44:07 +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
Robin Appelman 136c4ef925
dont expose metadata etag for now
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-11-13 12:39:36 +01:00
Robin Appelman 1b6e647b63
expose filecache extension data in FileInfo
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-11-13 12:39:32 +01:00
John Molakvoæ 13960b69da
Merge pull request #17509 from nextcloud/fix/application-singleton
Fix Application instances created multiple times
2019-11-04 18:18:32 +01:00
Robin Appelman 964dc0a955
set retention obligation on existing `expiration` in tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-11-04 16:54:22 +01:00
Arthur Schiwon e8095cf737
use OCP\EventDispatcher\Event over Symfony's deprecated Event
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-10-17 13:31:48 +02:00
Christoph Wurst 543190f8b3
Do not create Application instances directly
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-10-11 08:33:09 +02:00
Robin Appelman ce433637da
allow trash backends to overwrite the tooltip for trash items
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-10-05 10:23:30 +02:00
blizzz 8c77d3bfb6
Merge pull request #16664 from nextcloud/bugfix/emit-moveToTrash-limit
Emit moveToTrash event only for the deleting user
2019-09-06 17:46:03 +02:00
Roeland Jago Douma d744c04a86
Merge pull request #16534 from nextcloud/trash-copy-free-space
dont try to copy trash items to user if the user has not enough free space
2019-09-04 20:06:43 +02:00
Robin Appelman 9bf8ee701f
Update apps/files_trashbin/lib/Trashbin.php
Co-Authored-By: Morris Jobke <hey@morrisjobke.de>
2019-09-04 13:06:07 +02:00
Roeland Jago Douma f452e23a7d
Merge pull request #16666 from nextcloud/feature/calendar/delegation
Feature/calendar/delegation
2019-08-15 19:30:45 +02:00
Roeland Jago Douma 01a4644cad
Use the proxymapper to obtain valid proxy data
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-08-15 15:41:27 +02:00
Roeland Jago Douma 8e7c287e2a
Use the owner from the storage
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-08-07 16:47:43 +02:00
Jakub Onderka 41f8be47eb files_trashbin: File can be without extension
Signed-off-by: Jakub Onderka <jakub.onderka@gmail.com>
2019-08-07 16:04:09 +02:00
Julius Härtl b1832c8bef
Emit moveToTrash event only for the deleting user
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-08-06 17:45:50 +02:00
Robin Appelman fafce34aa0
dont try to copy trash items to user if the user has not enough free space
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-07-29 14:05:49 +02:00
Christoph Wurst 3174012adf Add event dispatcher to OCP
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-06-25 10:02:27 +02:00
Roeland Jago Douma 50a2ab8bc6
Use higher preview resolution in trashbin
For #14639

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-03-16 14:56:26 +01:00
Robin Appelman 62a969f056
dont try to restore a trashbin item to a readonly target
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-03-14 16:18:43 +01:00
Robin Appelman 0d41138c6e
prevent recursion when moving a file to the trashbin
Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-03-13 11:42:01 +01:00