Christoph Wurst
d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Robin Appelman
e0d688c365
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>
3 years ago
Julius Härtl
3c47aaa2b1
Delete files that exceed trashbin size immediately
Signed-off-by: Julius Härtl <jus@bitgrid.net>
3 years ago
Morris Jobke
930c97a0ef
Fix variable name and add spaces around path in info log line
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 years ago
Christoph Wurst
1f7f93a695
Update license headers for Nextcloud 20 (again)
There are still lots of outdated headers, so time for another round of
updates.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Daniel Kesselberg
2513b64602
Change free space calculation
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
3 years ago
Christoph Wurst
2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Robin Appelman
c2c9a6a0e1
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>
3 years ago
Morris Jobke
e84504c4d6
Use IBootstrap for the files_trashbin app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
3 years ago
Robin Appelman
fcad692b4a
rollback cache rename if trashbin move fails
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Robin Appelman
5949849322
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>
4 years ago
Christoph Wurst
9e7426a101
Clean up container usage in files trashbin
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Robin Appelman
050e2fe346
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>
4 years ago
Joas Schilling
9001438879
Move files_trashbin to migrations
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Joas Schilling
d7c0b9cced
Also always return in app commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
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>
4 years ago
Christoph Wurst
cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
734c62bee0
Format code according to PSR2
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
1584c9ae9c
Add visibility to all methods and position of static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
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>
4 years ago
Christoph Wurst
14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst
6127c288e8
Fix license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
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>
4 years ago
Christoph Wurst
5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Georg Ehrke
c3748cfee3
respect shareapi_allow_share_dialog_user_enumeration in Principal backend for Sabre/DAV
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
4 years ago
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>
4 years ago
Robin Appelman
136c4ef925
dont expose metadata etag for now
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Robin Appelman
1b6e647b63
expose filecache extension data in FileInfo
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Robin Appelman
964dc0a955
set retention obligation on existing `expiration` in tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Arthur Schiwon
e8095cf737
use OCP\EventDispatcher\Event over Symfony's deprecated Event
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
4 years ago
Christoph Wurst
543190f8b3
Do not create Application instances directly
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Robin Appelman
ce433637da
allow trash backends to overwrite the tooltip for trash items
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Robin Appelman
9bf8ee701f
Update apps/files_trashbin/lib/Trashbin.php
Co-Authored-By: Morris Jobke <hey@morrisjobke.de>
4 years ago
Roeland Jago Douma
01a4644cad
Use the proxymapper to obtain valid proxy data
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Roeland Jago Douma
8e7c287e2a
Use the owner from the storage
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Jakub Onderka
41f8be47eb
files_trashbin: File can be without extension
Signed-off-by: Jakub Onderka <jakub.onderka@gmail.com>
4 years ago
Julius Härtl
b1832c8bef
Emit moveToTrash event only for the deleting user
Signed-off-by: Julius Härtl <jus@bitgrid.net>
4 years ago
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>
4 years ago
Christoph Wurst
3174012adf
Add event dispatcher to OCP
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Roeland Jago Douma
50a2ab8bc6
Use higher preview resolution in trashbin
For #14639
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
5 years ago
Robin Appelman
62a969f056
dont try to restore a trashbin item to a readonly target
Signed-off-by: Robin Appelman <robin@icewind.nl>
5 years ago
Robin Appelman
0d41138c6e
prevent recursion when moving a file to the trashbin
Signed-off-by: Robin Appelman <robin@icewind.nl>
5 years ago
Morris Jobke
dd2496b275
Use proper dependency injection for app manager
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
5 years ago
Morris Jobke
4704e719ed
Only fetch size of this storage without mount points - ref #14412
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
5 years ago