Instead of inaccurate pattern matching, use the list of users who we
know have access to the file to build the list of share keys.
This covers the following cases:
- Move/copy files into a subfolder within a share
- Unsharing from a user
- Deleting files directlry / moving share keys to trashbin
Whenever a delete operation is called twice in a row, it could happen
that the first call already deleted the file.
The second call would return an empty $ownerPath because the file does
not exist. That empty $ownerPath would run the key deletion operation on
the wrong path.
This fix adds checks in many places to make sure we don't use $ownerPath
when it's empty or null.
`glob` can return FALSE when the directory is empty, instead of an empty array,
causing an error at `foreach`.
"Note: On some systems it is impossible to distinguish between empty match and
an error."
See http://www.php.net/manual/en/function.glob.php -> Return Values
Any error in opening the trashbin directory returns 'true' for isEmpty.
An error is prevented by checking if the directory exists before trying to
open it.
Files app:
- removed file list template, now rendering list from JSON response
- FileList.addFile/addDir is now FileList.add() and takes a JS map with all required
arguments instead of having a long number of function arguments
- added unit tests for many FileList operations
- fixed newfile.php, newfolder.php and rename.php to return the file's
full JSON on success
- removed obsolete/unused undo code
- removed download_url / loading options, now using
Files.getDownloadUrl() for that
- server side now uses Helper::getFileInfo() to prepare file JSON response
- previews are now client-side only
Breadcrumbs are now JS only:
- Added BreadCrumb class to handle breadcrumb rendering and events
- Added unit test for BreadCrumb class
- Moved all relevant JS functions to the BreadCrumb class
Public page now uses ajax to load the file list:
- Added Helper class in sharing app to make it easier to authenticate
and retrieve the file's real path
- Added ajax/list.php to retrieve the file list
- Fixed FileActions and FileList to work with the ajax list
Core:
- Fixed file picker dialog to use the same list format as files app