Commit Graph

132 Commits

Author SHA1 Message Date
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
Roeland Jago Douma 9ce8e1ddc7 OCS API should return fancy OC url
* Also use the URLGenerator
2015-03-21 09:47:06 +01:00
Joas Schilling 05c4848954 Correctly get the unique mountpoint name when mounting the share
Previously the mount name was checked for uniqueness prior to inserting the
share. This caused problems, when two shares with the same name where done
or folder, mount point, local share with the same name was done, between
sending and accepting of the remote share
2015-03-17 16:03:24 +01:00
Roeland Jago Douma 4436a9ce35 Shares should have a least read permission
* Throw 400 when a share is created or updated without read permissions
* Added unit tests
2015-03-01 17:13:17 +01:00
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +01:00
Jenkins for ownCloud 6a1a4880f0 Updating license headers 2015-02-23 12:13:59 +01:00
Bjoern Schiessle 8a091629dc rename 'server-to-server sharing' to 'federated cloud' 2015-01-29 15:05:39 +01:00
Bjoern Schiessle 66f0db30b2 use uid provided by setupfs hook to mount server2server shares, otherwise mount will fail for public link shares 2015-01-26 16:54:50 +01:00
Bjoern Schiessle 24993280ed Next step in server-to-server sharing next generation, see #12285
Beside some small improvements and bug fixes this will probably the final state for OC8.

To test this you need to set up two ownCloud instances. Let's say:

URL: myPC/firstOwnCloud user: user1
URL: myPC/secondOwnCloud user: user2
Now user1 can share a file with user2 by entering the username and the URL to the second ownCloud to the share-drop-down, in this case "user2@myPC/secondOwnCloud".

The next time user2 login he will get a notification that he received a server-to-server share with the option to accept/decline it. If he accept it the share will be mounted. In both cases a event will be send back to user1 and add a notification to the activity stream that the share was accepted/declined.

If user1 decides to unshare the file again from user2 the share will automatically be removed from the second ownCloud server and user2 will see a notification in his activity stream that user1@myPC/firstOwnCloud has unshared the file/folder from him.
2014-12-19 15:20:24 +01:00
Bjoern Schiessle 698ecbf308 OCS API for server-to-server sharing 2014-12-04 13:18:13 +01:00