Christoph Wurst
28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
1584c9ae9c
Add visibility to all methods and position of static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 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>
6 years ago
Christoph Wurst
14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
a8a06a82d2
Remove trailing whitespaces from comments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
44577e4345
Remove trailing and in between spaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 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>
6 years ago
Christoph Wurst
85e369cddb
Fix multiline comments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Christoph Wurst
df9e2b828a
Fix mismatching docblock return types
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Roeland Jago Douma
78050ec531
Fix restoring shared versions
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Christoph Wurst
5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 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>
6 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>
6 years ago
John Molakvoæ (skjnldsv)
866c513871
Fix files_versions app LoadSidebar event
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
6 years ago
Arthur Schiwon
e8095cf737
use OCP\EventDispatcher\Event over Symfony's deprecated Event
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
6 years ago
Roeland Jago Douma
c1b8cb2e21
Set the proper filename for version downloads
Before it just used the internalid (timestamp often) which is not really
user friendly.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Christoph Wurst
543190f8b3
Do not create Application instances directly
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
6 years ago
Roeland Jago Douma
01a4644cad
Use the proxymapper to obtain valid proxy data
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Julius Härtl
e26187c7ff
Make sure we only fetch the file by id for the actual owner
Otherwise this will fetch all mounts for the file id which is quite
expensive and causes long saving times in big sharing structures
Signed-off-by: Julius Härtl <jus@bitgrid.net>
6 years ago
Robin Appelman
a0a3f534f7
allow non integer version ids
currently version ids are timestamps, but for storage provided versions
this is not always the case and they might be strings
Signed-off-by: Robin Appelman <robin@icewind.nl>
7 years ago
Robin Appelman
5209cdccdb
fix loading multiple version backends from one app
Signed-off-by: Robin Appelman <robin@icewind.nl>
7 years ago
Robin Appelman
ccfbee2af9
add way for version backends to programmatically specify if they should be used
this allows for backends that should only be used if specific conditions are met
Signed-off-by: Robin Appelman <robin@icewind.nl>
7 years ago
Morris Jobke
dd2496b275
Use proper dependency injection for app manager
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
7 years ago
Felix Nieuwenhuizen
56457505af
set availableSpace to 0 if userFolder not found
Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
7 years ago
Felix Nieuwenhuizen
0f43d1dfaa
use node API for free space calculation in versions app (same method as trashbin app)
Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
7 years ago
Roeland Jago Douma
7f88654147
Move of files_versions to webpack
* Move CSS into bundle
* Old merged.json no longer needed!
* No need to load the style still
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
7 years ago
Roeland Jago Douma
6415532508
Allow shared versions again in legacy backend
To make sure that the versions in the legacy backend are shared again we
have to check the storage of a file. Since all shared files are still on
the owners storage.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
7 years ago
Robin Appelman
fbe35c346d
actually return the user when creating version dav nodes
Signed-off-by: Robin Appelman <robin@icewind.nl>
7 years ago
Robin Appelman
4403d771ad
modular versions api
Allows apps to register version backends for storage types
The existing versions backend is wrapped in a "legacy" backend.
Signed-off-by: Robin Appelman <robin@icewind.nl>
7 years ago
Georg Ehrke
367ca563b4
allow admins to override FreeBusy capabilities without modifying ShareAPI capabilities
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
8 years ago
Roeland Jago Douma
39bb9c06d1
Delete the previews when a version is restored
Fixes #9469
When a version of a file is restored the previews are no longer valid.
Thus we should remove them so they are regenerated.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Roeland Jago Douma
cd53498256
Use more magic DI in files_versions
There is no need to register this. The system can figure out by itself
what it needs to do :)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Roeland Jago Douma
17f1653ceb
If not in debug disable principal listing
Trashbin and Version should have the same behaviour as the other
collections.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Roeland Jago Douma
5401732cd2
Allow to read get old versions
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Roeland Jago Douma
dd47ebb062
Add rollback
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Roeland Jago Douma
d40afac1b9
Add version collection to DAV
listed as
versions/<username>/versions/<file id>/<timastamp>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
8 years ago
Morris Jobke
dd34cb7540
Less deprecated calls to OCP\Util::writeLog
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
8 years ago
Morris Jobke
eb51f06a3b
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
8 years ago
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>
8 years ago
Morris Jobke
870fe20acc
Use $var[] = $a instead of array_push - 2x faster
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
8 years ago
Morris Jobke
e6efa755c9
Use short for of substr to not need strlen()
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
8 years ago
Morris Jobke
0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
8 years ago
Morris Jobke
5987099d2a
Remove unneeded check if app is enabled
App code will not be executable if the app is not enabled, because the autoloader refuses to load that class.
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
8 years ago
Bjoern Schiessle
90d7693997
allow apps to disable versions for some files
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
8 years ago
Joas Schilling
a20934227c
Remove undocumented config
Signed-off-by: Joas Schilling <coding@schilljs.com>
8 years ago
Joas Schilling
c23c05d4f6
Fix versions app
Signed-off-by: Joas Schilling <coding@schilljs.com>
8 years ago