Commit Graph

1045 Commits

Author SHA1 Message Date
Björn Schießle 6aa6d2186c
Merge pull request #10255 from nextcloud/add-support-for-room-shares
Add support for room shares
2018-08-09 10:44:11 +02:00
Daniel Calviño Sánchez e2e6f23b67 Suppress Phan warnings about calling undeclared class methods
The DeletedShareAPIController and ShareAPIController helpers for room
shares are defined in Talk, so the classes do not exist when Talk is not
installed. Due to this when the object returned by "getRoomShareHelper"
is used Phan complains that the class is not declared.

This is not a problem, though, because when the class is not available
"getRoomShareHelper" throws an exception, which is then caught where
that method was called. Therefore now those warnings from Phan are
suppressed (it would be better to use "@phan-suppress-next-line"
instead, but it is not yet available in our Phan version).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-08 14:25:44 +02:00
Daniel Calviño Sánchez 1ccc99ed83 Add support for room shares to the share owner updater
A user can move her own shares into a received share. When that happens
she is effectively handing over the ownership of the file, so the share
needs to be updated to reflect the new owner.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-08 14:25:43 +02:00
Daniel Calviño Sánchez 8084ba516f Add room shares to the MountProvider for shares
The MountProvider for shares creates mount points for the files shared
with the user, which makes possible to use the received shared files and
folders as regular files and folders.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-08 14:25:43 +02:00
Daniel Calviño Sánchez 382b27d035 Add support for room shares to DeletedShareAPIController
In some cases, the DeletedShareAPIController requires explicit handling
of each type of share (for example, to format a share for a
DataResponse). Room shares are implemented in an external app (Nextcloud
Talk), so in order to keep the controller as isolated as possible from
room share specifics all that explicit handling is done in a helper
class provided by the Talk app.

In other cases it is just enough to call the share manager specifying a
room share type; note that the share manager is guarded against share
types for which there is no provider, so it is not necessary to
explicitly check that before passing room shares to the share manager.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-08 14:25:43 +02:00
Daniel Calviño Sánchez 4ed7131e26 Add support for room shares to ShareAPIController
In some cases, the ShareAPIController requires explicit handling of each
type of share (for example, to format a share for a DataResponse). Room
shares are implemented in an external app (Nextcloud Talk), so in order
to keep the controller as isolated as possible from room share specifics
all that explicit handling is done in a helper class provided by the
Talk app.

In other cases it is just enough to call the share manager specifying a
room share type; note that the share manager is guarded against share
types for which there is no provider, so it is not necessary to
explicitly check that before passing room shares to the share manager.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-08 14:25:43 +02:00
MartB 5109743383 Fix multiSelectMenu for public shares #10536
Signed-off-by: Martin Böh (MartB) <mart.b@outlook.de>
2018-08-06 12:42:13 +02:00
Daniel Calviño Sánchez 96108ab858 Add event to load additional scripts in the auth page for public shares
Before the public share authentication page is rendered now an event to
load additional scripts is dispatched. Thanks to this any app can load
its own scripts that, when run on the browser, adjust as needed the page
generated by the server.

Note, however, that during the handling of the event apps are only able
to add scripts or styles to be loaded; they can not render arbitrary
content on the page, or change how the content is rendered by the
original template; all those changes have to be done by the scripts at
run-time.

This implies that the scripts of the apps can use only those parameters,
like the token of the share, added to the page when it is generated by
the "publicshareauth" template. Due to this, and given that the event is
being introduced to be used by Talk to inject the UI needed to request
the password for a share, the token of the share is now provided in the
generated page, just like done in the public share page.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-07-24 14:04:22 +02:00
Daniel Calviño Sánchez 7849630cef Add support for sending the password by Talk to ShareAPIController
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-07-24 14:04:17 +02:00
Bjoern Schiessle 72d2455577
return the as well note if we fetch a share
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-21 15:02:19 +02:00
Bjoern Schiessle 4f59c8e8ae
show note on public link page
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-21 15:02:18 +02:00
Bjoern Schiessle a93f2a648b
allow to add a personal note to a share
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-21 15:02:18 +02:00
Morris Jobke 82021b2b1b
Merge pull request #5280 from nextcloud/shared-with-display-name
sharedWithDisplayName & sharedWithAvatar
2018-07-13 17:29:57 +02:00
Daniel Calviño Sánchez 243df99fcf Fix formatting of email and circle shares
Due to a misplaced "||" instead of "===" the condition was always met,
so every share type in the conditional chain after the remote and remote
group shares was formatted as a remote/remote group share.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-07-12 21:24:55 +02:00
Bjoern Schiessle 412f6a6ecc
fix unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:21:00 +02:00
Bjoern Schiessle 3942d731d2
update unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:48 +02:00
Bjoern Schiessle 2abc705632
start to get fed group shares into the share dialog
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:47 +02:00
Bjoern Schiessle 7d2add622e
unshare from self
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:46 +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 b23032e4c5
implement federated group shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:44 +02:00
Roeland Jago Douma b49bc11fb3
Fix exception
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-07-05 12:43:57 +02:00
John Molakvoæ (skjnldsv) d86c1e9503
Disable sidebar on deleted share
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-07-05 12:43:57 +02:00
John Molakvoæ (skjnldsv) 3b835d8076
Js magic for deleted shares
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-07-05 12:43:57 +02:00
John Molakvoæ (skjnldsv) 6a0552224d
getDeletedSharedWith method
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-07-05 12:43:57 +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 cdf8abb060
look for correct OCM permissions
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:31 +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 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
Daniel Calviño Sánchez 6cb2cb33ac Fix getting the information of group share as a sharee
When the receiver of a group share modifies it (for example, by moving
it to a different folder) the original share is not modified, but a
"ghost" share that keeps track of the changes made by that specific user
is used instead.

By default, the method "getShareById" in the share provider returns the
share from the point of view of the sharer, but it can be used too to
get the share from the point of view of a sharee by providing the
"recipient" parameter (and if the sharee is not found then the share is
returned from the point of view of the sharer).

The "ShareAPIController" always formats the share from the point of view
of the current user, but when getting the information of a specific
share the "recipient" parameter was not given, so it was always returned
from the point of view of the sharer, even if the current user was a
sharee. Now the "recipient" parameter is set to the current user, and
thus the information of the share is returned from the point of view of
the current user, be it the sharer or a sharee.

Note that this special behaviour of "getShareById" happens only with
group shares; with other types of shares the share is the same for the
sharer and the sharee, and thus the parameter is ignored; it was added
for them too just for consistency.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-06-29 08:20:19 +02:00
Roeland Jago Douma 9f658febca
Fix ShareControllerTest
* Removed tests that are now handled by the middleware
* Updated tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-20 08:53:37 +02:00
Roeland Jago Douma 20e514690c
Don't allow public share pages if link sharing is disabled
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-20 08:53:37 +02:00
Roeland Jago Douma 31392c2443
Move public auth page over
Now this is in core so the basics (that 99% of the app will want to
use) looks always the same.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-20 08:53:37 +02:00
Roeland Jago Douma 366981fba6
Move public preview endpoint over
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-20 08:53:37 +02:00
Roeland Jago Douma 53a1b9a84e
Quick hack to make the files sharing app work with this properly
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-20 08:53:37 +02:00
Julius Härtl 5b60508af4
Merge pull request #9893 from kevgathuku/update-unshare-message
Update message shown when unsharing a file
2018-06-18 16:44:54 +02:00
Kevin Ndung'u 5d9c1d3fea
Update message shown when unsharing a file
Signed-off-by: Kevin Ndung'u <kevgathuku@gmail.com>
2018-06-18 13:12:23 +03:00
Roeland Jago Douma 8c47a632e0
Allow updating the token on session regeneration
Sometimes when we force a session regeneration we want to update the
current token for this session.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-14 08:09:36 +02:00
Maxence Lange 0009adae80 SharedWithDisplayName + SharedWithAvatar
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-05-21 01:24:45 +02:00
Roeland Jago Douma d6d0e60136
Regenerate session id after public share auth
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-17 22:07:20 +02:00
Roeland Jago Douma 055a003661
Use an actual function of the storage to determine needsPartFile
We have a function for it so better to override that. Also because other
codes that might check this should get the right value.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-01 15:02:36 +02:00
Morris Jobke c907b68842
Merge pull request #9284 from nextcloud/bugfix/9279/strict_sharee_api
Make ShareesAPIController strict
2018-04-25 11:53:52 +02:00
Roeland Jago Douma 4d5a2cce8d
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-24 08:07:25 +02:00
Roeland Jago Douma 3b3ff39431
Make ShareesAPIController strict
Fixes #9279

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-23 22:05:21 +02:00
Roeland Jago Douma 3b34a77c58
Make the ShareAPIController strict
Fixes #9279

With types we can force php to not cast a full nummeric user to an int.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-23 20:31:57 +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 0b6e197491
Add background job to refresh federated discovery
Once a day refresh the information automatically in cron

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-18 19:20:26 +02:00
Julius Härtl eb19899f8e
Move common menu templates to public API
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-04-05 11:09:19 +02:00
Roeland Jago Douma d6cda3f2a6
When formatting a share node an Empty target is invalid
Fixes #9028

For federated shares the share table holds no target information (since
it is on the other server). So when a node is actually invalid and not
found we should not display it anymore in the shared with sections etc
and thus throw the proper exceptions.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-04 11:33:05 +02:00
Roeland Jago Douma b2e34167eb
Merge pull request #8976 from nextcloud/dep_user_code
Remove deprecated functions from OCP\User
2018-03-28 08:23:57 +02:00