Commit Graph

212 Commits

Author SHA1 Message Date
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Julius Härtl 45c3ee7f36
Set proper share type when converting link shares to federated shares
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-04-21 14:35:28 +02:00
Christoph Wurst 28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:54:27 +02:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +02:00
Christoph Wurst 44577e4345
Remove trailing and in between spaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 16:07:47 +02:00
Christoph Wurst afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 13:54:22 +02:00
Christoph Wurst 41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +02:00
Christoph Wurst 2fbad1ed72
Fix (array) indent style to always use one tab
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 10:16:08 +02:00
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Christoph Wurst 463b388589
Merge pull request #20170 from nextcloud/techdebt/remove-unused-imports
Remove unused imports
2020-03-27 17:14:08 +01:00
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Christoph Wurst 74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:08:08 +01:00
Georg Ehrke 789719da90
Default value of lookupServerEnabled should be the same everywhere
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-03-17 10:41:19 +01:00
Roeland Jago Douma e0715d704e
Use proper andwhere clause
Fixes #19248

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-02-03 12:17:46 +01:00
Maxence Lange fc54df81d0 remove non-circles-generated shares only
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2020-01-07 09:40:41 -01:00
Christoph Wurst 1b46621cd3
Update license headers for 18
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-20 09:23:25 +01:00
Maxence Lange 3513833ccd confirm auth on share generated by Circles
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
returns true

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
DI

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
DI

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2019-12-16 11:01:02 -01:00
John Molakvoæ 3a563fdfd7
revert protected 2019-12-06 16:10:30 +01:00
John Molakvoæ (skjnldsv) ab2b3d2755
Fix external sharing loading script
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2019-12-06 16:10:30 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Roeland Jago Douma 5195be108f
Merge pull request #17985 from nextcloud/enh/use_displayname_federated_share
Use the displayname for federated notifications
2019-11-18 20:22:31 +01:00
Roeland Jago Douma 17fae47bdb
Use the displayname for federated notifications
Since we have the showing this is a lot nicer.
Especially on alrge isntances where the uid can be totally random.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-18 15:00:33 +01:00
Joas Schilling e96c9e0e4a
Add the notifier and the API endpoint for user shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-11-12 17:33:50 +01:00
Roeland Jago Douma 8085ca4cc4
Get all shares as iterable
Sometimes we need all shares or rather a specific subset of shares but
creating dedicated functions is a pain. This just returns an iterable
object for all shares so we can loop over them without allocating all
the memory on the system.

It should not be used by any user called code. But in an occ command or
background job it is fine IMO.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-10-30 09:45:27 +01:00
Roeland Jago Douma 22f6960f83
Allow removing federated shares of locally reshared files
* UserA shares a folder to UserB
* UserB does a federated share to userC@serverC
* UserB now tries to revoke the federated share

Before we always tried to notify the remote cloud. The case that the
file was reshared locally was not considered. This patch makes sure not
to try to notify a federated server if both users are local users.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-10-03 15:21:04 +02:00
Joas Schilling 44bc697a93
Update Federated sharing notifier
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-07-15 15:12:43 +02:00
Morris Jobke db4e8d67e0
Show share settings only if incoming federated shares are allowed
Fixes #15802

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2019-05-31 17:38:45 +02:00
Julius Härtl 8f11d2a39b
Only show sharing section if it has content
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-05-20 18:07:24 +02:00
Jos Poortvliet b3cdc317e0
update URL for federation 2018-12-27 13:12:23 +01:00
Julius Härtl 4dda244ce2
Fix logo path in personal federated sharing settings
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-10-29 13:18:39 +01:00
Joas Schilling ea21aa3f7a
Use numeric placeholders if there are multiple, so that RTL languages can operate better
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-10-09 14:32:14 +02:00
Bjoern Schiessle 1d5a9c3f97
handle unshare request from owner
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:47 +02:00
Bjoern Schiessle f5a816262c
accept/decline group shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:46 +02:00
Bjoern Schiessle 7a48a85dca
fix notification when a group share is received
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:45 +02:00
Bjoern Schiessle b23032e4c5
implement federated group shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:44 +02:00
Bjoern Schiessle c8631d607e
add setting to enable/disable federated group sharing
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:41 +02:00
Roeland Jago Douma d805959e81
Add API to undelete delete group shares
When a group share is deleted we keep track of this in the DB.
Right now it is only possible for a recipient to get back the share by
asking the sharer to delete it and to share it again. This doesn't
scale.

This endpoint makes it possible to get back the share.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-07-05 12:43:56 +02:00
Bjoern Schiessle ce567b6121
remove unused code
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 12:43:43 +02:00
Bjoern Schiessle 086e7a0aa2
remove debug output 2018-07-02 11:29:31 +02:00
Bjoern Schiessle 8d4da30bf5
add support for different share types
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:31 +02:00
Bjoern Schiessle 27814127dd
make sure that remote url gets stored with a trailing '/'
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:30 +02:00
Bjoern Schiessle 5d0d33a0d4
remove unused method
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:29 +02:00
Bjoern Schiessle 84fc188dfc
some minor fixes and clode cleanup
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:29 +02:00
Bjoern Schiessle 957b27f282
replace \OCP\Federation\Exception\ShareNotFoundException with the generic \OCP\Share\Exception\ShareNotFound exception
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:29 +02:00
Bjoern Schiessle 61485e3e60
fix check for reshare permissions
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:29 +02:00
Bjoern Schiessle ed415726d3
send RESHARE_CHANGE_PERMISSION message
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:29 +02:00
Bjoern Schiessle 2bb1956c1f
implement RESHARE_UNDO notification
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:29 +02:00
Bjoern Schiessle d77eedd23b
- Don't remove share before all notifications are created, otherwise we miss information necessary to create the notifications
- Don't send message to owner/sharer about revoked re-shares twice.

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:29 +02:00
Bjoern Schiessle a176a1f318
implement unshare notification
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:28 +02:00
Bjoern Schiessle fab4e561f4
send reshare over OCM API
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:28 +02:00
Bjoern Schiessle 41a1528888
implement decline share
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:28 +02:00
Bjoern Schiessle 8889e14c7c
implement accept share notification
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:28 +02:00
Bjoern Schiessle bbce8c3ea1
adjust to latest api version
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:28 +02:00
Bjoern Schiessle db428ea547
send accept share notification (WIP)
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:27 +02:00
Bjoern Schiessle a3948e8a12
use new API to send a federated share if possible
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:27 +02:00
Bjoern Schiessle 21e64ec7f4
implement receiving of federated shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:27 +02:00
Bjoern Schiessle 5cfe20675d
start implementing federated sharing 2.0
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:27 +02:00
Arthur Schiwon 38a90130ce
move log constants to ILogger
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-04-26 10:45:52 +02:00
Morris Jobke 093cd01ac2
Fix DI for federated file sharing controller
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-04-23 13:49:28 +02:00
Morris Jobke dd34cb7540
Less deprecated calls to OCP\Util::writeLog
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-04-22 20:41:49 +02:00
Roeland Jago Douma f4fd0224db
Do not use \OCP\DB anymore
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-26 14:40:23 +02:00
Morris Jobke 4cbcf6f920
Remove old code to be compatible with Nextcloud 9 and before
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-03-12 14:21:12 +01:00
Morris Jobke eb51f06a3b
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-29 12:03:47 +01:00
Joas Schilling c2b1bd92d6
Merge pull request #8063 from nextcloud/inline-value
Return value immediately instead of assigning to a one-time variable
2018-01-26 10:15:39 +01:00
Morris Jobke 0a56d2185e
Return value immediately instead of assigning to a one-time variable
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 00:02:03 +01:00
Morris Jobke 4dbee99b7b
Remove useless return statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-25 22:50:40 +01:00
Morris Jobke 2a38605545
Properly log the full exception instead of only the message
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-23 10:57:21 +01:00
Morris Jobke 55532f19d9
Cleanup OC_User and OCP\User
* mainly removes deprecated methods and old static code

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-16 18:39:11 +01:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Lukas Reschke d321e9792e
Add |null to PHPDoc
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-08-01 08:20:15 +02:00
Bjoern Schiessle 8b3dfcc429
use OCSv2 to make sure that the error also arrives at the web front-end
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-07-21 12:09:13 +02:00
Allan Nordhøy de6b7668c1 sent, an invitation, - successful 2017-07-14 17:28:57 +02:00
Joas Schilling 33cb45d4a3
Fix owner cloud id in unshare activity
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-07-10 12:20:56 +02:00
Joas Schilling b69ddfba8b
Fix activity emails for accept/decline of remote shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-07-10 12:10:36 +02:00
Marin Treselj 3470d0a44e
Simplified Nextcloud logo icon
Signed-off-by: Marin Treselj <marin@pixelipo.com>
2017-07-02 14:14:49 +02:00
Arthur Schiwon da53162656
We're on 13 now…
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-06-26 11:03:41 +02:00
Arthur Schiwon 1ace1657b6
adapt federatedfilesharing
also drops IE8 switch

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-06-23 12:38:05 +02:00
Bjoern Schiessle 7c2d473d76
add new config switched for the global scale architecture
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-05-29 18:19:28 +02:00
Morris Jobke c54a59d51e
Remove unused use statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-22 19:23:31 -05:00
Roeland Jago Douma ad24b86013 Merge pull request #4350 from nextcloud/adjust-old-bruteforce-protection-annotations
Adjust existing bruteforce protection code
2017-04-19 09:27:23 +02:00
Morris Jobke 10290eb006 Merge pull request #2834 from nextcloud/accesListToShareManager
Access list to share manager
2017-04-15 13:06:24 -05:00
Lukas Reschke 727688ebd9
Adjust existing bruteforce protection code
- Moves code to annotation
- Adds the `throttle()` call on the responses on existing annotations

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-04-14 13:42:40 +02:00
Joas Schilling 629b7c0fc3
Adjust docs and make !$currentAccess simpler
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-13 12:58:52 +02:00
Joas Schilling 3c1365c0d1
Fix returned paths for remote shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-13 12:58:51 +02:00
Joas Schilling 4bcb7d88b5
Return the token as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-13 12:58:51 +02:00
Joas Schilling 91e650791d
Return the paths for the users without setting them all up
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-13 12:58:50 +02:00
Roeland Jago Douma 12afd7d1d5
Add mail element to access list
* Each provider just returns what they have so adding an element won't
require changing everything
* Added tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-04-13 12:58:50 +02:00
Roeland Jago Douma 2cbac3357b
Offload acceslist creation to providers
* This allows for effective queries.
* Introduce currentAccess parameter to speciy if the users needs to have
currently acces (deleted incomming group share). (For notifications)

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-04-13 12:58:50 +02:00
Lukas Reschke 66835476b5
Add support for ratelimiting via annotations
This allows adding rate limiting via annotations to controllers, as one example:

```
@UserRateThrottle(limit=5, period=100)
@AnonRateThrottle(limit=1, period=100)
```

Would mean that logged-in users can access the page 5 times within 100 seconds, and anonymous users 1 time within 100 seconds. If only an AnonRateThrottle is specified that one will also be applied to logged-in users.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-04-13 12:00:16 +02:00
Björn Schießle b90e91144b Merge pull request #3614 from nextcloud/discover-federatedsharing-endpoints
Discover federatedsharing endpoints
2017-04-12 16:01:07 +02:00
Morris Jobke 1729e4471f
Update comments to Nextcloud
* based on PR by @Ardinis
* see #4311

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-11 23:16:27 -05:00
Roeland Jago Douma 53bca14a27
Do proper DI
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-04-11 15:04:01 +02:00
Bjoern Schiessle 449011dae7
remove discovery manager in favour of the OCSDiscoveryService
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-11 15:04:01 +02:00
Robin Appelman a555672f21
properly quota table names in getSharesInFolder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-04-10 17:59:40 +02:00
Bjoern Schiessle 78f0b5c19f
simplify return statement
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-10 09:44:23 +02:00
Bjoern Schiessle 9afd160e66
allow to disable upload to lookup server, by default it is enabled
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-07 16:30:07 +02:00
Robin Appelman 1c59240894
Add api to change the remote of an incoming federated share
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-10 14:45:40 +01:00
Joas Schilling 0be2921966
Fix DI of the cloud id manager into apps
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-02-14 12:47:46 +01:00