Commit Graph

962 Commits

Author SHA1 Message Date
Thomas Müller 530f7229e7 Merge pull request #19869 from owncloud/cache-adjustcurrentmtimeonrename
On rename, also refresh storage_mtime of the target file
2015-10-29 11:57:00 +01:00
Robin Appelman 33eb13e415 The root of a storage always exists 2015-10-29 11:21:50 +01:00
Vincent Petry b900782513 Also adjust storage_mtime of target after rename
Some storages like Dropbox change their mtime on rename...
2015-10-26 15:41:23 +01: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 9d7138aa50 Dont lock /$user/files 2015-10-23 14:59:16 +02:00
Jörn Friedrich Dreyer 2895c91291 Merge pull request #17641 from owncloud/fix_objectstore_rename
don't move files in cache twice, fixes renaming for objectstores
2015-10-19 17:18:57 +02:00
Robin Appelman 9c5337ca3e Merge pull request #19833 from owncloud/fix_view_rmdir
Removemount expects absolutePath
2015-10-19 16:22:42 +02:00
Robin Appelman 0c6c36d0c5 fix objectstore files having create permissions 2015-10-16 21:41:51 +02:00
Jörn Friedrich Dreyer aab226cef7 don't move files in cache twice, fixes renaming for objectstores 2015-10-16 21:41:51 +02:00
Roeland Jago Douma 3a14cfc295 Removemount expects absolutePath 2015-10-16 14:14:00 +02:00
Thomas Müller 2ff55560e2 Remove $ETagFunction - it was never used 2015-10-16 13:17:12 +02:00
Thomas Müller f2889dc6e4 Consolidate webdav code - move all to one app 2015-10-16 13:17:12 +02:00
Bjoern Schiessle dd6cb67030 check if fopen was successful before continue 2015-10-15 16:27:38 +02:00
Bjoern Schiessle c7883b1769 only wrap source if fopen was successful 2015-10-15 16:27:38 +02:00
Bjoern Schiessle 8185eaa6dd also detect files in a .part folder as part file 2015-10-12 13:59:16 +02:00
Robin Appelman a42dd117e2 Merge pull request #19654 from owncloud/db-locking-no-scan-transaction
Dont use a transaction in the scanner while using db based locking
2015-10-09 12:38:54 +02:00
Robin Appelman 7ff5a6ccf4 Dont use a transaction in the scanner while using db based locking 2015-10-08 15:29:04 +02:00
Jörn Friedrich Dreyer 89a63ec74b make mkdir recursive, add phpdoc to api 2015-10-08 14:54:21 +02:00
Robin Appelman c2d76d2010 fix internal path when searching in storage root 2015-10-06 15:54:17 +02:00
Olivier Paroz 3173ed29df The minimum size for internalRootLength is 1 2015-10-06 15:54:17 +02:00
Thomas Müller 0385a62363 Merge pull request #19597 from owncloud/update-license-headers
update licence headers via script
2015-10-06 11:18:35 +02:00
Morris Jobke 8366ce2767 deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
Morris Jobke b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Robin Appelman b1ce53f890 use a normal rename when moving from the same storage in the encryption wrapper 2015-10-05 20:55:57 +02:00
Thomas Müller 56c35da8d5 Merge pull request #19416 from owncloud/node-hook-connector
pass view hooks trough to the node hooks
2015-10-05 10:25:04 +02:00
Thomas Müller ff89824135 Merge pull request #19272 from owncloud/mimetypes-enhanced
Introduce a few new mimetypes for code, fix recursive mimetype aliases
2015-10-02 17:50:34 +02:00
Vincent Petry 64ca00925b Prevent moving mount point into already shared folder (outgoing)
It is already not allowed to share a folder containing mount points /
incoming shares.

This fixes an issue that made it possible to bypass the check by moving
the incoming share mount point into an existing outgoing share folder.
2015-10-02 16:14:42 +02:00
Robin McCorkell aeb20675dd Allow recursive mimetype aliases
application/xml -> text/html -> text/code
2015-10-02 15:28:23 +02:00
Bjoern Schiessle e7232a848b versions should always use the keys of the original file, no need to create new one 2015-10-01 10:10:19 +02:00
Olivier Paroz cc64c09ee5 Make postScanFile and postScanFolder available to OC\Files\Utils\Scanner 2015-09-30 01:53:49 +02:00
Olivier Paroz 9ea05c898e Always send a postScanFile event when done scanning a file
postScanFile is important when scanning external storage as it indicates when the file is ready to be used
2015-09-30 01:50:15 +02:00
Robin Appelman 1e5a41f008 Add hook connector to connect view and node hooks 2015-09-28 17:18:40 +02:00
Thomas Müller 330ea18996 Merge pull request #19303 from owncloud/usecorrectvariable
Use correct variable
2015-09-24 11:34:19 +02:00
Thomas Müller df75c17e52 Merge pull request #16479 from owncloud/core-fixgetrelativepathwrongmatches
Prevent wrong matches in getRelativePath
2015-09-24 10:25:00 +02:00
Jörn Friedrich Dreyer 8b90a55831 use correct variable
wow ... just wow ...
2015-09-23 23:41:39 +02:00
Jörn Friedrich Dreyer d54d9a573f Revert "use correct variable"
This reverts commit 52cbaff061.
2015-09-23 14:09:52 +02:00
Jörn Friedrich Dreyer 52cbaff061 use correct variable
wow ... just wow ...
2015-09-23 13:59:37 +02:00
Thomas Müller bcdb3c26da Merge pull request #19236 from owncloud/call_dot_directories_function
Replaces if ($file === '.' || $file === '..') by public function call isIgnoredDir
2015-09-23 11:34:23 +02:00
Thomas Müller ad71d92acf Merge pull request #19247 from owncloud/fix_locking_copy_operation
locking: handle exceptions correctly during copy operation
2015-09-23 11:28:27 +02:00
Martin 491250320a Replaces if ($file === '.' || $file === '..') by if(\OC\Files\Filesystem::isIgnoredDir($file)). Eases to find where this operation is used. 2015-09-22 17:53:15 +02:00
Lukas Reschke 63b2bc136a Move mimetype files into /resources/config/ 2015-09-22 16:43:28 +02:00
Vincent Petry b9cd5bc1dc Prevent wrong matches in getRelativePath
Before this fix, the root "/files" with path "/files_trashbin" would
return "_trashbin" as relative path...
2015-09-22 11:34:37 +02:00
Bjoern Schiessle 17a64360e5 catch excexptions during the copy operation and make sure that we free the lock correctly 2015-09-22 11:32:10 +02:00
Robin Appelman 4ecf710dcd dont download the existing file for webdav if we're going to overwrite it 2015-09-21 13:45:25 +02:00
Robin McCorkell a0094d28f1 Explicitly cast number to integer 2015-09-16 11:22:52 +01:00
Robin Appelman 9883d5b85d Merge pull request #18915 from owncloud/node-getfoldercontents-use-view-logic
Use the view logic for getFolderContent for the node api
2015-09-15 18:04:01 +02:00
Robin McCorkell 5ca690e2f8 Use integer for availability instead of bool 2015-09-15 10:18:32 +02:00
Lukas Reschke 1924dd348a Merge pull request #18653 from owncloud/dav-stream-guzzle
stream webdav downloads using http client
2015-09-11 17:10:10 +02:00
Robin McCorkell 188d0e09b8 Add reset method to mimetype loader
Used to solve concurrency issues
2015-09-11 12:44:53 +01:00
Robin Appelman 9f11b27797 Use the view logic for getFolderContent for the node api 2015-09-08 22:38:50 +02:00
Robin McCorkell cdf01f0419 Split mimetype handling to new class 2015-09-04 17:28:20 +01:00
Robin Appelman 1c10fb5c9f also use httpclient for uploadFile 2015-09-01 18:01:27 +02:00
Robin McCorkell 9e9ffb1356 Allow access to full alias and mapping arrays 2015-09-01 14:07:14 +01:00
Robin Appelman 4cb8ca1860 Check result of storage wrappers 2015-08-30 10:02:42 +02:00
Robin Appelman df8cb2cc63 stream webdav downloads using http client 2015-08-29 14:56:15 +02:00
Björn Schießle 6e210d960c Merge pull request #18423 from owncloud/occ_encrypt_all
occ command line tool to encrypt all files
2015-08-28 20:44:55 +02:00
Bjoern Schiessle e51fe617d8 copy always file by file to encrypt/decrypt it if needed 2015-08-26 14:58:22 +02:00
Vincent Petry fe575feca8 Prevent scanner going crazy with unavailable storages 2015-08-24 16:42:53 +02:00
Vincent Petry 31d62c10bf Merge pull request #17501 from tbartenstein/patch-1
Update fileinfo.php
2015-08-24 09:57:27 +02:00
Robin McCorkell 3b27603762 Revert "Fix mounting wrapped storages resulting in many-layered wrapping"
This reverts commit 75a5e6e12b.
2015-08-19 14:41:43 +01:00
Robin McCorkell 3bb793b6a7 Implement password authentication mechanisms
Introduces the basic password authentication mechanism, along with a
mechanism based on ownCloud credentials stored in the user session.

Change to lib/private is an extension of PermissionsMask, as
isSharable() override was missing.

Session credentials auth mechanism now disables sharing on applied
storages, as credentials will not be available.
2015-08-19 14:20:09 +01:00
Thomas Müller d5bba42030 Merge pull request #17932 from owncloud/fix_move_files
make sure that hooks are emitted properly on file move operation
2015-08-11 13:54:09 +02:00
Robin McCorkell 214729a552 Merge pull request #14779 from owncloud/use-iterator-directory
Use the new IteratorDirectory instead of the fakedir wrapper
2015-08-07 22:16:47 +01:00
Morris Jobke ca8f7fd69c Merge pull request #18124 from owncloud/share-permwrongvar
Fix removal of share permissions when share disabled for user
2015-08-07 18:42:35 +02:00
Vincent Petry b3a1aef934 Merge pull request #13641 from owncloud/cache-storage-status
Store storage availability in database
2015-08-07 17:31:03 +02:00
Vincent Petry 143e4a81f0 Fix removal of share permissions when share disabled for user 2015-08-07 15:43:27 +02:00
Bjoern Schiessle 51a67a54e0 always update file cache, the cache can handle partial data correctly if the file doesn't already exists in the file cache 2015-07-31 17:14:32 +02:00
Thomas Müller 22fd04eb41 Merge pull request #17981 from owncloud/correct-regex
Correct regular expressions
2015-07-30 16:07:46 +02:00
Lukas Reschke ad4c731c4c Correct regular expressions
Previously the regex was only matching on single characters. Meaning that file names such as "👍.txt" where possible while "👍" alone never was. This check apparently never worked as expected.
2015-07-30 11:22:14 +02:00
Robin McCorkell 3ef680d966 Merge pull request #17950 from owncloud/config-dontdetectfschangesinrootbydefault
Disable filesystem_check_changes by default
2015-07-29 15:34:02 +01:00
Vincent Petry 7c9405a921 Disable filesystem_check_changes by default
This will prevent detecting remote changes done in the data folder /
root storage by default. In the rare cases where the data folder is
shared with other apps/users outside ownCloud and change detection is
needed, the admin will have to set the option explicitly from now on.

Note that this doesn't affect external storages which have their own
setting in the mount options.
2015-07-29 12:01:12 +02:00
Bjoern Schiessle fb4c99fe06 make sure that we emit the hooks if a file gets moved from a subfolder to the root folder with the nodes API 2015-07-29 11:02:38 +02:00
Morris Jobke c34e63bb1f Merge pull request #15543 from rullzer/mimetypedetector
Mimetypedetector
2015-07-28 13:35:26 +02:00
Vincent Petry 6ada1e3276 Merge pull request #17902 from owncloud/fix_17898
get header size before we open the file to avoid locking exception
2015-07-27 16:58:32 +02:00
Thomas Müller 68f14a943a Merge pull request #17840 from owncloud/fix-enc-wrapper-without-encryption
Only set is encrypted when encryption is enabled
2015-07-27 16:06:39 +02:00
Roeland Jago Douma d276aebf40 Pass config dir as parameter to detection class
In order to properly test the mimetype function:

* constructor takes path to configdir
* Added unit tests for mimetype (only if vfsStream is available)
2015-07-27 14:59:49 +02:00
Roeland Jago Douma 88fb389eab Proper deprecate methods 2015-07-27 14:59:49 +02:00
Roeland Jago Douma 9cdd637050 Loading of mapping/aliases is done in class 2015-07-27 14:59:49 +02:00
Roeland Jago Douma 141a0f0f47 Move mimetypedetection to files/type/detection 2015-07-27 14:59:45 +02:00
Roeland Jago Douma 6db6689740 Added mimetype detector
* Copied unit tests from old functions
2015-07-27 14:58:45 +02:00
Bjoern Schiessle 0736b45d92 get header size before we open the file to avoid locking exception 2015-07-27 14:29:07 +02:00
Robin Appelman f74525c349 check if the user is trying to scan a valid path 2015-07-27 11:21:48 +02:00
Joas Schilling 9cee8ff9f8 Only set is encrypted when encryption is enabled 2015-07-23 15:18:59 +02:00
Robin McCorkell 75a5e6e12b Fix mounting wrapped storages resulting in many-layered wrapping
This usually doesn't cause issues, but in unit tests sometimes a wrapped
storage is passed to Filesystem::mount() and gets rewrapped, hitting the
XDebug function nesting level limit when used.
2015-07-20 16:27:26 +01:00
Robin McCorkell df19cabb44 Store storage availability in database
Storage status is saved in the database. Failed storages are rechecked every
10 minutes, while working storages are rechecked every request.

Using the files_external app will recheck all external storages when the
settings page is viewed, or whenever an external storage is saved.
2015-07-20 16:27:26 +01:00
Björn Schießle f363fc2d4a Merge pull request #17540 from owncloud/enc_detect_legacy_files2
make sure that we always detect legacy files correctly
2015-07-17 21:42:32 +02:00
Bjoern Schiessle 16d8014cdd set targetIsEncrypted to true if file cache indicates that we try to read a encrypted file 2015-07-17 13:30:08 +02:00
Bjoern Schiessle a2e2005e67 make sure that we always detect legacy files correctly 2015-07-17 13:30:08 +02:00
Morris Jobke 3fae984b56 Merge pull request #17282 from owncloud/s2s-catchremotelockexceptions
Throw lock exceptions if remote share returned 423 status code
2015-07-17 11:34:34 +02:00
Robin Appelman da951ba059 Use the new IteratorDirectory instead of the fakedir wrapper 2015-07-15 13:57:53 +02:00
Vincent Petry f62d94c4ff Throw StorageNotAvailable if propfind on root failed
If PROPFIND fails with 404 or 405 on the remote share root, it means the
storage is not available. Throw StorageNotAvailable is such case.
2015-07-13 18:28:53 +02:00
Morris Jobke 1006ec56ce Merge pull request #17481 from rullzer/mimetype-list
Move mimetypes.list.php to config/mimetypemapping.dist.json
2015-07-13 08:31:18 +02:00
Morris Jobke d52e197b0d Merge pull request #16965 from owncloud/getUserFolder-in-IRootFolder
Add getUserFolder to IRootFolder
2015-07-09 14:29:47 +02:00
tbartenstein c48e00294c Update fileinfo.php
Edits isMounted() to remove the check for 'local' prefix, so that folder icons are displayed correctly (see issue #10712)
2015-07-08 18:48:11 +02:00
Roeland Jago Douma 35fba1ef9f Move mimetypes.list.php to config/mimetypemapping.json
This allows users to add new mimetypemappings (extention -> mimetype)
themself. And not have to wait until a new release for updated
mimetypes.

Fixes: #15384
2015-07-08 13:18:58 +02:00
Thomas Müller 9120942bcf Merge pull request #16924 from owncloud/copy-recursive-polyfill
add recursive copy polyfill for storage backends
2015-07-06 17:05:36 +02:00
Thomas Müller d3ac73c0c9 Remove OC_Log 2015-07-03 18:00:16 +02:00
Vincent Petry 3df27a01be Merge pull request #17379 from owncloud/kill-file-mapper
Remove file mapper - was only use in Windows and never worked properly
2015-07-03 17:53:47 +02:00
Robin Appelman de4e4cb6ea also dont download existing on fopen when using w+ and wb+ 2015-07-03 15:53:02 +02:00