Commit Graph

751 Commits

Author SHA1 Message Date
Robin Appelman f338329ddf inject the correct external share manager into the storage 2016-02-25 14:49:25 +01:00
Thomas Müller d1ef43481d Merge pull request #22444 from owncloud/fix-federated-share-delete
get the actual user instead of a federated cloud id
2016-02-18 16:44:57 +01:00
Vincent Petry e1dbae1467 Properly trigger testRemote after getting a 404 from remote fed share
Whenever a remote fed share's shareinfo call returns a 404, don't
directly assume the storage is not available by throwing
StorageNotAvailableException. We need to properly throw
NotFoundException to trigger the later logic that calls testRemote()
that verifies that the 404 is not from a broken server but really from
an obsolete share.
2016-02-18 11:57:03 +01:00
Bjoern Schiessle 8985181305 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:17:00 +01:00
Thomas Müller e99c4d83dc Merge pull request #22317 from owncloud/fix_invisible_linkshares
Do not allow invisible link shares
2016-02-12 11:10:58 +01:00
Thomas Müller 4d24929e05 Merge pull request #22307 from owncloud/remove-notification-on-unshare-and-on-errors
Remove notification on unshare and on errors
2016-02-11 14:02:44 +01:00
Roeland Jago Douma 745bfda41f Fix migration step to avoind invisible shares 2016-02-11 13:29:23 +01:00
Joas Schilling 2263b8b693 Remove the notification if accepting/declining failed because of 404 2016-02-11 10:41:55 +01:00
Joas Schilling 5dc63e34b4 Add translations of unshare activities 2016-02-10 15:42:48 +01:00
Joas Schilling 65e1e4a202 Mark the accept button as primary 2016-02-10 08:40:45 +01:00
Joas Schilling c769f5775d Create the actions with the correct ID 2016-02-10 08:40:45 +01:00
Joas Schilling 49dd693d8f Bring the messages inline 2016-02-10 08:40:45 +01:00
Joas Schilling 3ff88c8c84 Revert "Disable the remote sharing notifications until they work properly"
This reverts commit 6bc93c7401.

Conflicts:
	apps/files_sharing/lib/external/manager.php
2016-02-10 08:40:44 +01:00
Robin Appelman f9f2800016 check share permissions in share controller 2016-02-09 15:03:00 +01:00
Roeland Jago Douma 623a0e4637 Example hook check 2016-02-09 10:36:44 +01:00
Arthur Schiwon cd68500731 throw hooks when accessing a link share 2016-02-09 00:34:10 +01:00
Roeland Jago Douma 3c4e511792 Update the migration step to include federated shares
Now federated shares will also be updated to the flat
reshare model.
2016-02-08 15:11:48 +01:00
Roeland Jago Douma f4edfb6dfb Gracefull handle link shares rename hook
Fixes #21678

The hook is called on all renames. However when we use a link share
the getUserFolder fails. We now just opt out.
2016-02-05 13:57:57 +01:00
Roeland Jago Douma 453ea6698d [Share 2.0] Fix public link sharing 2016-02-03 19:25:29 +01:00
Roeland Jago Douma 4d7130ad31 [Share 2.0] Add exceptions to OCP 2016-02-02 14:07:11 +01:00
Thomas Müller e60b217156 Merge pull request #22015 from owncloud/share-no-permissions
Block shares that dont have the correct source permissions
2016-02-02 10:26:06 +01:00
Robin Appelman e3b5639fc1 Block shares that dont have the correct source permissions 2016-01-29 13:05:53 +01:00
Roeland Jago Douma 6151a0540b Update the initiator of the share as well in migration 2016-01-28 19:24:23 +01:00
Roeland Jago Douma b85770d636 Update reshares in batches as not to run out of memory 2016-01-28 19:24:23 +01:00
Björn Schießle dc8d43575f upgrade to sharing 2.0, remove hierarchical re-shares 2016-01-28 19:24:23 +01:00
Robin Appelman 1369f2c684 cleanup shared cache 2016-01-28 11:46:43 +01:00
Roeland Jago Douma 34e912ab6b [Share 2.0] Fix interfaces and comments
* Made comments more clear
* Removed unneeded methods
* IShares shareTime is now a proper DateTime object
* IShares getPath -> getNode & setPath -> setNode
* Fix unit tests
2016-01-28 07:54:09 +01:00
Roeland Jago Douma 185b9c6edd [Share 2.0] Move IShare to OCP 2016-01-27 22:04:37 +01:00
Joas Schilling ee02165005 Move the notification API to public namespace 2016-01-22 10:32:42 +01:00
Roeland Jago Douma 18421e7e68 Directly get from the server container
* Updated unit tests
2016-01-20 21:12:26 +01:00
Roeland Jago Douma 67f5216160 Do not use deprected activities API 2016-01-20 21:12:26 +01:00
Roeland Jago Douma 9467859e42 Get correct path for activity downloads 2016-01-20 21:12:26 +01:00
Roeland Jago Douma 894a88ca51 [Share 2.0] Make public link work without view 2016-01-20 21:12:26 +01:00
Roeland Jago Douma 8734ebe505 [Share 2.0] Make link share download use share manager 2016-01-20 21:12:26 +01:00
Roeland Jago Douma 717697313b [Share 2.0] Move tests over the sharemanager
Nice side effect... pure unit tests!
2016-01-20 21:12:26 +01:00
Roeland Jago Douma 0ebc92c44a [Share 2.0] Move showing link share to sharing 2.0 2016-01-20 21:12:26 +01:00
Robin Appelman 30d6222e64 handle noopscanner in shared scanner 2016-01-15 15:37:31 +01:00
Robin Appelman ddbbe1742f propagate folder size in the same query for write updates 2016-01-15 15:36:52 +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
Robin Appelman a3d50ef49a add watcher interface 2016-01-14 12:54:42 +01:00
Robin Appelman 5fae07f422 add scanner interface 2016-01-14 12:54:42 +01:00
Robin Appelman 6d321f5f6b Return a class from cache operations instead of an array 2016-01-14 12:54:42 +01:00
Thomas Müller a5e46226ef Merge pull request #21615 from owncloud/shared-islocal
implement isLocal for shared storage
2016-01-13 10:34:23 +01:00
Thomas Müller 682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Robin Appelman af1e810607 implement isLocal for shared storage 2016-01-11 13:58:22 +01:00
Robin Appelman 300eb54c87 de-deplicate getUidAndFilename 2016-01-11 11:40:58 +01:00
Björn Schießle c4b65170f2 show display name but internally use the user name 2015-12-14 17:25:10 +01:00
Thomas Müller 54dbe5b8d5 Merge pull request #20989 from owncloud/fix_20769
Update parent when moving share into recieved share
2015-12-09 13:07:57 +01:00
Thomas Müller bc744ff6de Merge pull request #21038 from owncloud/share-computesharepermissions-notstore
Fix (re)share permission checks in a few code paths
2015-12-09 10:04:56 +01:00
Vincent Petry 6e4006d139 Add reshare permission checks
Added in isSharable() in incoming remote share.
Added in isSharable() in regular incoming share.
Added in FileInfo to make sure the proper attributes are returned to the
clients.
2015-12-08 13:13:26 +01:00
Joas Schilling 5453daab03 More fixes to the docs 2015-12-08 09:11:50 +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
Roeland Jago Douma d38949f423 Update parent when moving share into recieved share
Fixes #20769

When I receive a share and move a share of myself into that share (which
is allowed currently) I effectively hand over ownership of the files I
move. So we need to update the share I move to have as a parent the
share I move it into. Else our mounting system gets confused.
2015-12-07 16:28:33 +01:00
Scrutinizer Auto-Fixer 97f9213da9 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-12-07 12:05:27 +00:00
Thomas Müller df6fc6cc70 Add the user's cloud id to the vCard 2015-12-02 09:14:41 +01:00
Thomas Müller 50f6817ce9 Merge pull request #20439 from owncloud/etag-propagate-in-storage
Take submount etag into account for folder etags
2015-11-25 12:49:54 +01:00
Björn Schießle 964fa1fce3 use hooks to auto add server to the list of trusted servers once a federated share was created 2015-11-24 11:34:38 +01:00
Robin Appelman 888df3933d take the etag of child mounts into account for the folder etag
this replaces shared etag propagation
2015-11-19 13:32:00 +01:00
Robin Appelman 1d82d93baa Implement getOwner for external share storage 2015-11-18 17:08:02 +01:00
Robin Appelman 0397871f7e Split checkUpdate 2015-11-03 18:23:22 +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
Morris Jobke db25f41da8 handle NoUserException in sharing code
* setup LDAP users
* share from an LDAP user
* delete that LDAP user
* log in as share recipient
* before: unhandled NoUserException
* after: NoUserEception is logged and share is not shown anymore
2015-10-22 17:04:36 +02:00
Roeland Jago Douma ec296b0b7d Add backgroundjob to expire link shares
Simple background job to expire the link shares.

* added unit tests
2015-10-20 08:18:53 +02:00
Thomas Müller f2889dc6e4 Consolidate webdav code - move all to one app 2015-10-16 13:17:12 +02:00
Thomas Müller 8cbf76755e Merge pull request #19643 from owncloud/public-download-spinner
Set download cookie on public download
2015-10-09 14:10:29 +02:00
Vincent Petry ececa90709 Set download cookie on public download 2015-10-08 12:50:56 +02:00
Thomas Müller b2872ef759 Merge pull request #19589 from owncloud/shares-external-mount-provider
Move the setup of external share mounts to a mountprovider
2015-10-07 17:46:33 +02:00
Robin Appelman 59cf817308 Merge pull request #19511 from owncloud/etag-share-permissions-update
Mark shares as dirty when changing permissions
2015-10-06 18:09:12 +02:00
Robin Appelman 17756ebf5b fix phpdoc 2015-10-06 16:37:43 +02:00
Robin Appelman d3c1fcf961 Fix getEtag for roots of shared storages 2015-10-06 16:33:37 +02:00
Vincent Petry d546c5bb59 Propagate shares etag when group membership changed 2015-10-06 15:02:22 +02:00
Robin Appelman 47c71d8e87 use microtime 2015-10-06 13:00:30 +02:00
Robin Appelman 0817024e6f Mark shares as dirty when changing permissions 2015-10-06 11:38:41 +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 e468b38bd4 sanitize mountpoint 2015-10-05 17:14:39 +02:00
Robin Appelman e1c562f66b extract the mount provider from the manager 2015-10-05 16:39:11 +02:00
Robin Appelman 76a528e511 Make the external share manager a mount provider 2015-10-05 16:18:14 +02:00
Thomas Müller 710b7dd81c Merge pull request #19487 from owncloud/split_share_middleware
Split files_sharing middelware
2015-10-05 10:57:11 +02:00
Thomas Müller ccbdcf0ab3 Merge pull request #19522 from owncloud/activity-395-less-sidebar-text
Activity 395 less sidebar text
2015-10-02 12:13:53 +02:00
Roeland Jago Douma 3d2acb5003 sharingcheckmiddleware now handles externalshares as well
Added new annotations for the externalsharescontroller class
* @NoOutgoingFederatedSharingRequired
* @NoIncomingFederatedSharingRequired

By default both are required for all functions in the
externalSharesController.

A proper exception is thrown and then a 405 is returned instead of the
default error page. Since it is only an API endpoint this makes more
sense.

Unit tests added and updated
2015-10-02 12:03:53 +02:00
Roeland Jago Douma dc38e674a5 Split files_sharing middelware
Since for external shares there is no need for link shares to be enabled
we should check which controller is actually being called.

This makes sure that in all cases we verify that the files_sharing app
is enabled. But only for the share controller (public shares) we check
if the API is enabled and if links are enabled.

TODO: add checks for federated sharing as well
2015-10-02 11:56:11 +02:00
Joas Schilling e478d925c3 Fix intendation 2015-10-02 10:01:33 +02:00
Joas Schilling 17ab8e6c39 Use shorter text on the sidebar for files_sharing activities 2015-10-02 10:01:33 +02:00
Roeland Jago Douma c924b6740a Do not return unneeded info 2015-10-02 08:11:50 +02:00
Roeland Jago Douma 7310c4166a Added '../remote_shares' endpoint
* list incoming remote shares at 'remote_shares'
* get per share info at 'remote_shares/<ID>'
* delete remote share with a DELETE to 'remote_shares/<ID>'
2015-10-02 07:40:04 +02:00
Lukas Reschke 22e724e829 Only intercept exceptions of type "NotFoundException" instead of any Exception
The sharing backend may throw another exception for example when the activity app encounters a problem. Previously this just triggered a 404 error page and the exception got not logged at all. With this change such exceptions get not intercepted and regularly handled as exceptions so that we have meaningful log data. Also the user will be shown a window informing him that an error happened.

Helps to debug cases such as https://github.com/owncloud/core/issues/19465
2015-09-30 13:32:20 +02:00
Vincent Petry b4998e7d29 Allow public auth to recognize sesssion
When a public link password has been input, its auth is stored in the
session.
This fix makes it possible to recognize the session when using public
webdav from the files UI.
2015-09-28 11:52:04 +02:00
Roeland Jago Douma db02173627 Reflect enabled shareAPI in capabilities
If the shareAPI is disabled we not return the other sharing
capabilities.

This allows clients to properly check if sharing is even available.
2015-09-25 20:12:41 +02:00
Thomas Müller 2c37d5f7d8 Merge pull request #13145 from owncloud/issue/11951-activity-sharing-email
Publish an activity when sending a share link via email
2015-09-25 13:48:33 +02:00
Robin Appelman 7d53427ee6 only initialize once 2015-09-23 16:22:53 +02:00
Robin Appelman 88f03192ba Delay listening to owner changes untill we use a share for that owner 2015-09-23 16:22:53 +02:00
Roeland Jago Douma 4dba046712 Respect disabled sharing API settings
If the sharing API setting is disabled that sharing check middle ware
should block the request. Thus making link shares unavailable.
Fixes #18970

* Unit test added
* Unit tests updated
2015-09-22 15:12:16 +02:00
Joas Schilling 2e1cfe03e9 Publish an activity when sending a share link via email 2015-09-22 13:09:21 +02:00
Thomas Müller 75425b28df Merge pull request #18679 from owncloud/add-reshare-activities
Add reshare activities for the parent sharee and the original file owner
2015-09-18 11:59:30 +02:00
Thomas Müller 93eb73b0bb Merge pull request #18986 from owncloud/federated_capabilities
Expose federated sharing capabilities to authenticated users
2015-09-18 11:58:54 +02:00
Joas Schilling 6bc93c7401 Disable the remote sharing notifications until they work properly 2015-09-17 11:14:28 +02:00
Joas Schilling 59967599ac Fix the parameter order in the translation 2015-09-16 06:47:40 +02:00
Joas Schilling fe8ef0dd36 Add reshare activities for the parent sharee and the original file owner 2015-09-15 17:36:56 +02:00
Roeland Jago Douma 91dfcab055 Expose federated sharing capabilities to authenticated users 2015-09-15 15:10:13 +02:00
Joas Schilling 38001d824b Move interfaces to private until they are no longer experimental 2015-09-08 09:01:02 +02:00
Joas Schilling 805f1d0096 Scrap the notifications when the share is accepted or declined 2015-09-08 09:01:01 +02:00
Joas Schilling d191a0dacc Add notifications for remote shares 2015-09-08 09:01:01 +02:00
Joas Schilling 7af7fdd929 Use context function call instead of static 2015-09-07 14:28:20 +02:00
Roeland Douma 24f5f50b20 Merge pull request #18742 from owncloud/mimetype-updatedb
Introduce mimetype DB update occ command
2015-09-06 16:56:35 +02:00
Robin McCorkell cdf01f0419 Split mimetype handling to new class 2015-09-04 17:28:20 +01:00
Morris Jobke e1a79cd651 Avoid re-propagation of shares during one propagation run
* fix was proposed by @nickvergessen
2015-09-04 16:17:27 +02:00
Robin Appelman fd7b210654 Delay setting up the filesystem for a share owner untill the share is used 2015-09-03 13:46:08 +02:00
Vincent Petry 6848f25c0d Merge pull request #18477 from owncloud/fed-alwaysdetectremotechanges
Always detect remote changes for fed sharing
2015-08-24 12:17:23 +02:00
Lukas Reschke 0a1d551090 Use IClientService to check for remote ownCloud instances
1. Allows to set a timeout (though still not perfect but way better than before)
2. Allows to have unit tests
3. I also added unit tests for the existing controller code
4. Corrected PHPDoc on IClient
2015-08-22 14:39:43 +02:00
Vincent Petry d658d8dd4e Always detect remote changes for fed sharing
This is even more important now that filesystem_check_changes is 0 by
default.
2015-08-21 15:32:53 +02:00
Robin McCorkell 99b54e102d Prevent shares being added to oc_storages via availability 2015-08-20 22:43:46 +01:00
Robin McCorkell 6e47661afd Fix extracting basename from path in sharing 2015-08-18 13:41:47 +01:00
Roeland Jago Douma dce5d9b5d1 Add public upload to capability 2015-08-14 20:03:32 +02:00
Joas Schilling 70504920e7 Fix default values of sharing capabilities
The problem is the UI used a different default than the capabilities.
So when you never touched the config, the setting in admins said "disabled"
while the capabilities said "enabled".
2015-08-13 12:46:52 +02:00
Joas Schilling acd54fbeda Merge pull request #16528 from owncloud/activity-302-improve-settings
Activity 302 improve settings
2015-08-11 11:24:27 +02:00
Roeland Jago Douma e84cffc063 Moved core apps to the capabilities manager
* Files
* Files_Sharing
* Files_Trashbin
* Files_Versions
2015-08-10 10:45:16 +02:00
Robin Appelman 859da8f0b3 just pass the share instead of searching for it 2015-08-05 15:41:29 +02:00
Robin Appelman 7b70343dc3 fix infinite loops with propagating etags on reshares 2015-08-03 17:33:12 +02:00
Joas Schilling a1037f1679 Do not use magic strings when there are constants for it 2015-07-22 15:10:34 +02:00
Morris Jobke 2d691c2fb4 Merge pull request #17381 from owncloud/fix_sharing_add_to_group
[sharing] fix addToGroup hook
2015-07-21 13:30:41 +02:00
Vincent Petry 3d6be69f25 Throw storage not available on guzzle error
If the remote server is in maintenance mode, we must throw storage not
available exception instead of not found which might auto-remove the
share.
2015-07-13 18:51:25 +02:00
Thomas Müller 14eef434ff Merge pull request #17290 from owncloud/remove-readonly-wrapper
Replace readonly wrapper with permissions mask
2015-07-06 15:36:11 +02:00
Joas Schilling 4dbc8ab77f Merge pull request #17335 from owncloud/better-federated-cloud-sharing-activities
Improve federated cloud sharing activities
2015-07-06 10:23:33 +02:00
Bjoern Schiessle 763b601e4a use the correct user if we update the share table 2015-07-03 15:58:52 +02:00
Joas Schilling 2118713477 Add OCS api to get, accept and decline remote shares 2015-07-03 09:30:49 +02:00
Joas Schilling ddb8cc2303 Use federated cloud id as a parameter type 2015-07-02 13:14:02 +02:00
Vincent Petry aedf4848f7 Merge pull request #17324 from owncloud/fix-duplicated-line-in-doc-block
Fix duplicated line in doc block
2015-07-02 13:00:22 +02:00
Joas Schilling aa7c8ad191 Add the item name to the federated sahre activity 2015-07-02 12:28:48 +02:00
Joas Schilling 95faaad5cf Use the app constant to fix the grouping 2015-07-02 12:27:58 +02:00
Joas Schilling 7e3f8d3ac1 Use the item name when refering to the unaccepted remote share 2015-07-02 12:26:06 +02:00
Joas Schilling bfcb8ffeb3 Merge pull request #17246 from owncloud/share-lock-owner-parent
lock parent folders for the owner when locking a shared file as recipient
2015-07-02 10:38:08 +02:00
Joas Schilling a6ea91996c Fix duplicated line in doc block 2015-07-02 10:24:16 +02:00
Vincent Petry 9c06975bd5 Fix scanFile signature to avoid boring warning 2015-07-01 16:29:11 +02:00
Robin Appelman dd20cd1995 remove no longer needed readonly wrapper 2015-07-01 15:45:54 +02:00
Robin Appelman 3c0be7d126 only lock the parent folders 2015-07-01 15:10:25 +02:00
Robin Appelman d6f56ea609 lock parent folders for the owner when locking a shared file as recipient 2015-07-01 15:10:22 +02:00
Vincent Petry 5d3aa36355 Catch more error codes thrown by federated shares
Most of the time it doesn't make sense to forward Guzzle's
RequestException, so we convert it to StorageNotAvailable instead.

This prevents unpredictable error codes to block access to unrelated
folders needlessly.
2015-07-01 11:14:03 +02:00
Morris Jobke 044d2ece07 Merge pull request #15506 from rullzer/core_apps_oc_log2ocp_util
Move core apps from OC_Log::write to OCP\Util
2015-07-01 08:53:16 +02:00
Morris Jobke f25b71f70e Merge pull request #15475 from rullzer/files_sharing_OCP_DB
Move files sharing app (mostly) to OCP\DB
2015-07-01 08:53:03 +02:00
Vincent Petry b55f71ee03 Merge pull request #17083 from owncloud/share-etag-update-target
take share target into account when updating recipient etags
2015-06-29 09:10:37 +02:00
Lukas Reschke d1f0ff372e Merge pull request #17163 from owncloud/update-licenses
Update license headers
2015-06-27 20:22:23 +02:00
Olivier Paroz b30515ddda Signature of overriding method should match the parent 2015-06-26 17:45:04 +02:00
Thomas Müller 9558562883 Merge pull request #17082 from owncloud/shared-etag-propagate-file
Fix etag propagation for single file shares
2015-06-26 12:36:17 +02:00
Robin Appelman 0128a86df1 add some docs 2015-06-25 14:29:40 +02:00
Morris Jobke f63915d0c8 update license headers and authors 2015-06-25 14:13:49 +02:00
Robin Appelman c87ab65081 fix etag propagation for single file shares 2015-06-24 18:16:03 +02:00
Morris Jobke 4f2f8a6f28 [sharing] handle shares of users that aren't available anymore
* properly handle the case where an abandoned share is left and
  simply skip it
2015-06-23 18:22:36 +02:00
Robin Appelman 5e1865530b take share target into account when updating recipient etags 2015-06-22 18:21:54 +02:00