Commit Graph

159 Commits

Author SHA1 Message Date
Roeland Jago Douma 2831884e74 Fix OCS unit tests after two share merges
* Use getNode
* Return IShare object so typechecking is happy
2016-01-28 13:17:16 +01:00
Thomas Müller 295de6aad7 Merge pull request #21960 from owncloud/share2_ocs_fix_passing_empty_strings
Share2 ocs fix passing empty strings
2016-01-28 11:58:35 +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
Roeland Jago Douma 6957917b20 [Share 2.0] Allow using permissions to update link share 2016-01-27 20:36:36 +01:00
Roeland Jago Douma f5c45dfe7b [Share 2.0] Still allow isolated updates
Still allow isolated updates of parameters
2016-01-27 20:36:31 +01:00
Roeland Jago Douma b321ceef60 [Share 2.0] Also handle empty parameter in updateShare
* More sanity checks
* More unit tests
2016-01-27 20:34:06 +01:00
Roeland Jago Douma 35a3432793 [Share 2.0] When passing empty strings don't fail
The password and expiration date can be set to empty strings when
created. This is now handled gracefully.
2016-01-27 20:34:06 +01:00
Thomas Müller 6973718fb8 Merge pull request #21940 from owncloud/share2_do_not_returned_removed_group_shares
[Share 2.0] Properly handle user deleted group shares
2016-01-27 16:16:06 +01:00
Roeland Jago Douma a4900d721f [Share 2.0] Properly handle user deleted group shares
If a user deletes a group share we create a special share entry. To the
API this is just a normal group share for that user with permissions 0.
But we should not return this.
2016-01-27 09:02:12 +01:00
Roeland Jago Douma 46045ecc52 [Share 2.0] Add update share 2016-01-26 13:59:58 +01:00
Roeland Jago Douma 3a582e88e5 Comments from Vincent 2016-01-21 16:06:12 +01:00
Roeland Jago Douma 0a9cd91e1d [Share 2.0] Add subfiles=x 2016-01-21 15:56:44 +01:00
Roeland Jago Douma 3666c34a19 [Sharing 2.0] Start with getShares 2016-01-21 15:56:44 +01:00
Roeland Jago Douma d33e578665 [Share 2.0] Add share owner information to OCS Share API 2016-01-15 20:21:47 +01:00
Roeland Jago Douma cbd3050f4c [Share 2.0] Use full share id (providerId:shareId)
Now that we support multiple managers we communicate shares to the
outside as 'providerId:shareId'. This makes sures that id's are unique
when references from the OCS API.

However, since we do not want to break the OCS API v1 we need to
somewhat hack around this.

When we switch to OCS API v2 (which we should when we support more
custom providers). We will change the id to always be the fullShareId.
2016-01-13 16:35:15 +01:00
Roeland Jago Douma 67b7ebccd1 [Share 2.0] Add share provider factory
* Add providers
* Add share manager to server container
* Use share manager from server container
* Properly get the share manager
2016-01-13 16:35:14 +01:00
Roeland Jago Douma b4de427c1e [Share 2.0] Allow registering of share providers
* Properly register the default share provider
2016-01-13 16:35:07 +01:00
Thomas Müller 682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Roeland Jago Douma 71976a095f Do not lower the sharee search
Fixes #21639

When lowering the remote search it break remotes that have uppercase
letters like foo@example.com/ownCloud/

Backends do the mathcing so they should also make sure that the search
string is converted to the format they require.
2016-01-12 10:05:09 +01:00
Roeland Jago Douma 26280e1f19 [Sharing 2.0] Add L10N instance to manager for translated errors 2016-01-06 14:53:43 +01:00
Roeland Jago Douma 527b434cd2 [Sharing 2.0] Do not use static function to get numeric storage id 2016-01-06 14:53:43 +01:00
Roeland Jago Douma 0ab227310f [Sharing 2.0] General exceptions return 403
This is the same as the old behaviour
2016-01-06 14:53:43 +01:00
Roeland Jago Douma 38d3a638ed [Share 2.0] Enable share creation via OCS API 2016-01-06 14:53:43 +01:00
Morris Jobke ecdf88e41b Use proper public API for OC_Helper::getFileNameMimeType 2015-12-17 17:07:48 +01:00
Joas Schilling 372f54075f Only return the exact match, when it's allowed 2015-12-02 16:01:01 +01:00
Roeland Jago Douma 8d309767d7 [Sharing 2.0] Use the rootfolder to get the path of a share
We need to use the rootfolder here since we also other people than the
shareOwner can request a share.
2015-11-24 10:26:36 +01:00
Roeland Jago Douma 85976b7293 [Sharing 2.0] Fix phpdoc etc 2015-11-24 10:26:36 +01:00
Roeland Jago Douma ab02b5c36e [Sharing 2.0] Move authentication to the OCS API 2015-11-24 10:26:36 +01:00
Roeland Jago Douma a2b8483779 [Sharing 2.0] Default share provider only generic DI
No injection of userfolders etc. Only generic DI components
(IRootFolder) etc should be used to make sure we can also run this from
the cli
2015-11-24 10:26:36 +01:00
Roeland Jago Douma aeae73b364 [Sharing 2.0] Removed unused DI stuff
The share manager etc should not care about filtering stuff. They should
return what is asked for them.
2015-11-24 10:26:36 +01:00
Thomas Müller 57c9aa3ca7 Merge pull request #20558 from owncloud/remove-path-from-shared-with
Unset `path` for shared with me
2015-11-23 09:04:52 +01:00
Lukas Reschke 048ad25416 Use proper variable
`$shares` is not defined. Introduced with c3e7d324c5 and thus also in stable8.2
2015-11-18 22:28:48 +01:00
Lukas Reschke cbd94ce355 Unset `path` for shared with me
The original path is not required for a share recipient.
2015-11-17 14:09:29 +01:00
Roeland Jago Douma 1e9fc33212 [Share2.0] OCS Share API getShare uses new code 2015-11-16 13:32:28 +01:00
Roeland Jago Douma 0c566698a1 Use the old code for remote shares for now 2015-11-05 15:59:09 +01:00
Roeland Jago Douma 6624fa212a The new sharing code now handles deletion
OCS -> ShareManager -> DefaultShareProvider
2015-11-05 15:59:09 +01:00
Roeland Jago Douma 8b5179459a Prepare OCS Share endpoint 2015-11-05 15:59:09 +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
Joas Schilling 13dd62f7b0 Make sure that remote shares use the correct uid casing 2015-10-06 15:16:19 +02:00
Morris Jobke b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Roeland Jago Douma c3e7d324c5 Extend share info
The data from the share_external is not to much. Thus we enrich this
data with info from the filecache.

This allows endpoints using this to actually show usefull information.

The filecache might not be up to date but that is a sacrifice we need to
make in terms of speed. Else the number of remote PROPFINDS grows
lineary with the number of remote shares wich will make this endpoint
practically unusable.
2015-10-02 07:41:57 +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
Joas Schilling 19e7a08cbf Do not allow user enumeration if the config is disabled 2015-09-23 15:11:02 +02:00
Thomas Müller 0c37a28a60 Merge pull request #19087 from owncloud/disable-remote-share-notifications-for-now
Disable remote share notifications for now
2015-09-18 11:58:20 +02:00
Joas Schilling 6bc93c7401 Disable the remote sharing notifications until they work properly 2015-09-17 11:14:28 +02:00
Joas Schilling 9e1cd6d873 Change the order of the buttons 2015-09-17 11:14:27 +02:00
Joas Schilling 754850f473 Fix status code 2015-09-15 15:51:54 +02:00
Joas Schilling aa8b1b2894 Throw an error when the page count or perPage setting is invalid 2015-09-15 15:04:04 +02:00
Joas Schilling 665716095b Fix parameter name to match the specs 2015-09-15 12:14:14 +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
Björn Schießle 39bd4ea8f2 Merge pull request #18234 from owncloud/ocs_api_for_sharees_list
Add OCS API for sharees list
2015-09-01 17:09:57 +02:00
Roeland Jago Douma d54b497ade Return permissions and expiration on create share responses
Updated and added unit tests
2015-08-30 15:42:19 +02:00
Roeland Jago Douma 2aff11c80b Actually validate the expire date on share
* Added more intergration tests
2015-08-30 10:31:43 +02:00
Roeland Jago Douma fc64ea670d Allow to directly set the expireDate on a new (link)share
Since this extends the API we now properly parse the date. We only
accept valid ISO 8601 Dates (YYYY-MM-DD).

Currently this only works for link shares (it is just ignored for other
shares). Since we do not have user/group/federated expiring shares yet.

* Tests added
2015-08-29 12:39:47 +02:00
Joas Schilling 199d1dc239 Bring the coverage back to 100% 2015-08-26 11:54:25 +02:00
Joas Schilling 2a6e676048 Adjust tests 2015-08-26 11:54:25 +02:00
Joas Schilling aa2a894eb0 Fix performance issues of the sharees api 2015-08-26 11:54:25 +02:00
Joas Schilling 83b88c9a26 Do not return the current user himself 2015-08-26 11:54:25 +02:00
Joas Schilling 0227cfff08 Take a list of share IDs instead of the user and group names 2015-08-26 11:54:25 +02:00
Joas Schilling 5c4fbf5191 Inject the logger as well 2015-08-26 11:54:25 +02:00
Joas Schilling a0ab7a2578 Add all possible links next, prev, first and last 2015-08-26 11:54:25 +02:00
Joas Schilling c6ed40c9f8 Make shareType an array 2015-08-26 11:54:24 +02:00
Joas Schilling 068a81897e Add tests for "search()" 2015-08-26 11:54:24 +02:00
Joas Schilling 327c47a989 Do not use deprecated method in new code 2015-08-26 11:54:24 +02:00
Joas Schilling 3f64e9423b Split logic and global usage and add tests for "searchSharees()" 2015-08-26 11:54:24 +02:00
Joas Schilling a66aa1fe02 Filter the sharees with the existing shares 2015-08-26 11:54:24 +02:00
Joas Schilling 4b08783946 Use SearchResultSorter 2015-08-26 11:54:24 +02:00
Joas Schilling ad450d4f0e Add tests for "getGroups()" 2015-08-26 11:54:24 +02:00
Joas Schilling be257bc9cc Add tests for "getUsers()" 2015-08-26 11:54:24 +02:00
Joas Schilling 9b0058d2b0 Move test file to subdir 2015-08-26 11:54:24 +02:00
Roeland Jago Douma 8a5c1e6d4d Sort sharees
To ensure that pagination is working properly we need to make sure the
shares are always in the same order.

Sorting is first done by label (catches most instances)
If there is a user and a group with the same label we sort by shareType
If there are multiple users with the same label we sort those by
shareWith
2015-08-26 11:54:24 +02:00
Roeland Jago Douma 98301210a9 Start of OCS Share API sharees endpoint 2015-08-26 11:54:23 +02:00
Joas Schilling 4314c8fc6f Use an IEvent object instead of a huge parameter list 2015-08-19 17:44:57 +02:00
Joas Schilling e985dcc5a0 Send the file id when dealing with remote share responses 2015-08-19 17:44:57 +02:00
Thomas Müller d9172a1907 Merge pull request #14401 from owncloud/ux-s2s-ldap
allow login names to be used for s2s with LDAP users
2015-08-19 08:31:27 +02:00
Roeland Jago Douma f2e0c98a9b Move private functions to proper list of arguments
Some private static functions in the OCS Share API
(files_sharing/api/local.php) take a params array with all the info
inside. This is bad for the limited type checking and is not clear.
2015-08-11 15:16:22 +02:00
Roeland Jago Douma 868bc421cb Share app no longer use the OCS API icon
Switch to new javascript mimetype resolver
2015-07-06 16:32:15 +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
Joas Schilling 2118713477 Add OCS api to get, accept and decline remote shares 2015-07-03 09:30:49 +02:00
Joas Schilling df303b910a Allow sharing with type remote share 2015-07-03 09:28:56 +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
Morris Jobke 8f05d4b662 Merge pull request #16535 from rullzer/ocs_share_api_url
OCS Share API link shares now always have an url
2015-07-01 08:54:48 +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
Lukas Reschke d1f0ff372e Merge pull request #17163 from owncloud/update-licenses
Update license headers
2015-06-27 20:22:23 +02:00
Morris Jobke f63915d0c8 update license headers and authors 2015-06-25 14:13:49 +02:00
Joas Schilling 738b78f1b0 Use \OC\HintException and translate the hint 2015-06-22 15:34:06 +02:00
Roeland Jago Douma 41a8f45b93 OCS Share API link shares now always have an url
To make sure clients have the correct and latest link add an url field
to all OCS Share API return statements on public link shares.

* Added unit tests
2015-05-22 14:42:57 +02:00
Roeland Jago Douma dd3d0194a6 Move files sharing app (mostly) to OCP\DB 2015-05-18 11:06:23 +02:00
Morris Jobke b1713b2f75 Enable file icons & previews in "Shared ..." categories
* sharing API returns now the mimetype icon path
* file previews are now lazyloaded by default (as the doc says)
* fixes #16086
2015-05-06 18:32:52 +02:00
Morris Jobke e837927ad5 fix followup issues with unneeded parameters 2015-04-18 17:02:39 +02:00
Arthur Schiwon 66bc8145a9 allow login names to be used for s2s with LDAP users 2015-04-13 11:50:09 +02:00
Roeland Jago Douma b0aa17b13f OCS Fixes to allow setting of password without removing additional settings
- Added setPassword to share.php
- Fixed OCS API call
- Added unit tests
2015-03-30 14:00:50 +02:00
Jenkins for ownCloud b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Morris Jobke 2370af62ea Merge pull request #14998 from rullzer/ocs_api_new_url
OCS API should return fancy OC url
2015-03-24 17:04:31 +01:00