Commit graph

252 commits

Author SHA1 Message Date
Roeland Jago Douma
55af6b45f7
More tests
* PreviewController test
* PublicPreview test
* Versions Preview test
* Trash Preview test

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-03 14:00:33 +01:00
Roeland Jago Douma
d720a2fb57
Moved over files_versions
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2016-11-03 14:00:33 +01:00
Jörn Friedrich Dreyer
f8352fcb8d
introduce callForSeenUsers and countSeenUsers (#26361)
* introduce callForSeenUsers and countSeenUsers

* add tests

* oracle should support not null on clob

* since 9.2.0
2016-10-28 08:44:05 +02:00
Thomas Müller
297d2e48ad
Add occ command to expire the trashbin (#25878)
* Add occ command to expire the trashbin

* Fix versions folder in setup check
2016-08-29 14:30:40 +02:00
Jörn Friedrich Dreyer
d59cb04427
Skip version and trash expiry for users that never logged in 2016-08-10 10:51:51 +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
Morris Jobke
ba16fd0d33 Merge branch 'master' into sync-master 2016-07-07 11:29:46 +02:00
Carlos Damken
d58e6b59d3 Upgrading the log level From Debug to INFO to be consistent with files_trashbin (#25367) 2016-07-06 10:33:31 +02:00
Bjoern Schiessle
4a4cac611f we don't need to check permissions twice 2016-07-04 10:48:15 +02:00
Lukas Reschke
179a355b2c Merge remote-tracking branch 'upstream/master' into master-sync-upstream 2016-07-01 11:36:35 +02:00
Bjoern Schiessle
1b74cf72fb check permissions before rollback 2016-06-30 11:27:25 +02:00
Vincent Petry
f22af90c09 Hide revert button when no permission to revert 2016-06-28 13:00:58 +02:00
Vincent Petry
fa3dc909a4
Rollback version must also adjust cached size 2016-06-22 14:16:16 +02:00
Victor Dubiniuk
d82df7e490
Construct path to the version file from the current directory and filename. Fixes #22450 2016-06-02 15:47:12 +02:00
Lukas Reschke
aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Joas Schilling
b57f3126eb Move files_versions to PSR-4 (#24571) 2016-05-12 09:49:15 +02:00
Joas Schilling
9491d0f65b
Add missing use statement 2016-04-25 13:22:54 +02:00
Joas Schilling
9ebae0bdeb
Chunk the users correctly in the trashbin and versions background job 2016-04-20 10:36:15 +02:00
Lukas Reschke
72c8187cbb Keep "encryptedVersion" when calling \OC\Files\View::copy
When calling `\OC\Files\View::copy` we should also keep the version to ensure that the file will always have the correct version attached and can be successfully decrypted.

To test this the following steps are necessary (from https://github.com/owncloud/core/issues/22781#issuecomment-191328982):

1. setup a new ownCloud 9.0 beta2
2. enable encryption
2. upload a docx (5.7MB large)
3. upload the same file again and overwrite the existing file
4. I can download the original file and the first version
5. I restore the first version
6. restored version can no longer be downloaded with the error described above

The manual cache operation in `\OCA\Files_Versions\Storage` is unfortunately necessary since `\OCA\Files_Versions\Storage::copyFileContents` is not using `\OCP\Files\Storage::moveFromStorage` in the case when an object storage is used. Due to the workaround added in 54cea05271 the stream is directly copied and thus bypassing the FS.
2016-03-03 14:15:36 +01:00
Lukas Reschke
c353d51810 Remove Scrutinizer Auto Fixer 2016-03-01 17:48:23 +01:00
Lukas Reschke
933f60e314 Update author information
Probably nice for the people that contributed to 9.0 to see themselves in the AUTHORS file :)
2016-03-01 17:25:15 +01:00
Bjoern Schiessle
4ef035cc61 make sure that the file name doesn't end with a trailing slash. Can for example happen single files shared across servers 2016-02-19 13:15:09 +01:00
Bjoern Schiessle
ac1c3d27b7 get the actual user instead of a federated cloud id
$view->getUidAndFilename($filename); returns the federated cloud id in case of
a federated share. But in this case we need the local user who "owns" the file
which is the current logged in user in case of a federated share
2016-02-18 10:16:59 +01:00
Lukas Reschke
762636efcd Use cache directly instead of QB
In case somebody does not use oc_filecache
2016-02-10 12:30:39 +01:00
Lukas Reschke
5ccb9dfa7e Use database for keeping track of the version 2016-02-09 23:43:27 +01:00
Arthur Schiwon
3a796d1e15 Consolidate getQuota and setQuota methods in User instance 2016-02-09 17:16:43 +01:00
Arthur Schiwon
d2d6644702 use int values and constants instead of strings 2016-02-08 18:16:27 +01:00
Arthur Schiwon
b6e03fe261 versions provide more information when throwing hooks 2016-02-08 16:33:49 +01:00
Thomas Müller
6824704699 Merge pull request #21117 from owncloud/owner-file-exists
Only return an owner if the file exists + improved getUidAndFilename
2016-01-15 13:31:56 +01:00
Thomas Müller
682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Robin Appelman
94200b682c removed unused imports 2016-01-11 11:40:58 +01:00
Robin Appelman
282f67dad1 improve handling of non existing files in the trashbin 2016-01-11 11:40:58 +01:00
Robin Appelman
300eb54c87 de-deplicate getUidAndFilename 2016-01-11 11:40:58 +01:00
Morris Jobke
fb87441fd9 Deduplicate version expire jobs
* versionSize is calculated anyway in the expire job - > dropped
* offset/neededSpace was needed for expiry before the file is moved to the versions -> now this is included already in the currently used space because the expiry job is defered to a point in time after the version creation
* fixes #21108
2015-12-10 11:21:28 +01:00
Scrutinizer Auto-Fixer
0f1be1b601 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-12-07 20:08:20 +00:00
Lukas Reschke
8f09d5b67c Update license headers 2015-10-26 14:04:01 +01:00
Lukas Reschke
13e817e901 Throw exception on getPath if file does not exist
Currently the `getPath` methods returned `NULL` in case when a file with the specified ID does not exist. This however mandates that developers are checking for the `NULL` case and if they do not the door for bugs with all kind of impact is widely opened.

This is especially harmful if used in context with Views where the final result is limited based on the result of `getPath`, if `getPath` returns `NULL` PHP type juggles this to an empty string resulting in all possible kind of bugs.

While one could argue that this is a misusage of the API the fact is that it is very often misused and an exception will trigger an immediate stop of execution as well as log this behaviour and show a pretty error page.

I also adjusted some usages where I believe that we need to catch these errors, in most cases this is though simply an error that should hard-fail.
2015-10-25 17:58:21 +01:00
Robin Appelman
22c5c19376 handle versions expire for home storages with unlimited quota 2015-10-16 21:41:51 +02:00
Robin Appelman
54cea05271 Fix preserving file ids when restoring a file with object storage 2015-10-16 21:41:51 +02:00
Thomas Müller
4b31b349b8 Merge pull request #19595 from owncloud/fix-versions-log-entry
Reset to auto if not set
2015-10-06 13:45:35 +02:00
Morris Jobke
b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Victor Dubiniuk
99f1112e33 Reset to auto if not set 2015-10-05 20:52:25 +03:00
Robin Appelman
943c5069d4 Lock files when rolling back version 2015-10-02 17:08:39 +02:00
Georg Ehrke
b3ff773bbf delete cached preview when rolling back file's version
add random number using OC.parseQueryString and _.extend()

version rollback: add missing prefix to OC\Preview::post_delete

add test to assure that the rollback hook is called
2015-09-20 11:22:40 +02:00
Victor Dubiniuk
e3c067c2e1 Correct method title. Add docblock 2015-09-16 17:22:17 +03:00
Victor Dubiniuk
1f7ac2c309 Postrebase cleanup 2015-09-15 21:12:49 +03:00
Victor Dubiniuk
0cefbd76b9 Add expiration for versions older than max 2015-09-15 21:12:39 +03:00
Victor Dubiniuk
c3dc5b0317 Add method docblock 2015-09-15 17:08:54 +03:00
Victor Dubiniuk
f46b434a12 Namespacing, reusing 2015-09-15 17:08:54 +03:00