summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/Controller
Commit message (Collapse)AuthorAgeFilesLines
* Move to 1 template file for filesRoeland Jago Douma2018-10-011-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Compile filesummary handlebarsRoeland Jago Douma2018-09-271-0/+2
| | | | | | | | | | Fixes #11030 For https://github.com/orgs/nextcloud/projects/18 This template is now compiled so this no longer has to happen in the browser. Another step towards a stricter CSP. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #10838 from nextcloud/header-fixes-and-public-noteMorris Jobke2018-08-241-0/+1
|\ | | | | Header fixes and public note
| * Fix mobile view and add public share note viewJohn Molakvoæ (skjnldsv)2018-08-241-0/+1
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | Add rooms in the default candidate types to look for when sharingDaniel Calviño Sánchez2018-08-241-0/+6
|/ | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Merge pull request #10255 from nextcloud/add-support-for-room-sharesBjörn Schießle2018-08-092-9/+118
|\ | | | | Add support for room shares
| * Suppress Phan warnings about calling undeclared class methodsDaniel Calviño Sánchez2018-08-082-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Add support for room shares to DeletedShareAPIControllerDaniel Calviño Sánchez2018-08-081-5/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Add support for room shares to ShareAPIControllerDaniel Calviño Sánchez2018-08-081-4/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix multiSelectMenu for public shares #10536MartB2018-08-061-0/+1
|/ | | | Signed-off-by: Martin Böh (MartB) <mart.b@outlook.de>
* Add event to load additional scripts in the auth page for public sharesDaniel Calviño Sánchez2018-07-241-0/+29
| | | | | | | | | | | | | | | | | | | | | | 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>
* Add support for sending the password by Talk to ShareAPIControllerDaniel Calviño Sánchez2018-07-241-2/+31
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* return the as well note if we fetch a shareBjoern Schiessle2018-07-211-0/+1
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* show note on public link pageBjoern Schiessle2018-07-211-0/+1
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* allow to add a personal note to a shareBjoern Schiessle2018-07-211-3/+11
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Merge pull request #5280 from nextcloud/shared-with-display-nameMorris Jobke2018-07-131-2/+7
|\ | | | | sharedWithDisplayName & sharedWithAvatar
| * SharedWithDisplayName + SharedWithAvatarMaxence Lange2018-05-211-2/+7
| | | | | | | | | | Signed-off-by: Maxence Lange <maxence@nextcloud.com> Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Fix formatting of email and circle sharesDaniel Calviño Sánchez2018-07-121-1/+1
| | | | | | | | | | | | | | | | 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>
* | update unit testsBjoern Schiessle2018-07-111-1/+7
| | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* | start to get fed group shares into the share dialogBjoern Schiessle2018-07-111-0/+10
| | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* | implement federated group sharesBjoern Schiessle2018-07-111-40/+53
| | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* | Fix exceptionRoeland Jago Douma2018-07-051-0/+1
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Disable sidebar on deleted shareJohn Molakvoæ (skjnldsv)2018-07-051-1/+1
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | Js magic for deleted sharesJohn Molakvoæ (skjnldsv)2018-07-052-5/+62
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | getDeletedSharedWith methodJohn Molakvoæ (skjnldsv)2018-07-051-11/+1
| | | | | | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* | Add API to undelete delete group sharesRoeland Jago Douma2018-07-051-0/+119
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix getting the information of group share as a shareeDaniel Calviño Sánchez2018-06-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix ShareControllerTestRoeland Jago Douma2018-06-201-32/+7
| | | | | | | | | | | | | | * Removed tests that are now handled by the middleware * Updated tests Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Move public auth page overRoeland Jago Douma2018-06-201-17/+0
| | | | | | | | | | | | | | 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>
* | Move public preview endpoint overRoeland Jago Douma2018-06-202-11/+35
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Quick hack to make the files sharing app work with this properlyRoeland Jago Douma2018-06-201-84/+57
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Allow updating the token on session regenerationRoeland Jago Douma2018-06-141-1/+1
| | | | | | | | | | | | | | 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>
* | Regenerate session id after public share authRoeland Jago Douma2018-05-171-0/+1
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #9284 from nextcloud/bugfix/9279/strict_sharee_apiMorris Jobke2018-04-251-5/+6
|\ | | | | Make ShareesAPIController strict
| * Make ShareesAPIController strictRoeland Jago Douma2018-04-231-5/+6
| | | | | | | | | | | | Fixes #9279 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Fix testsRoeland Jago Douma2018-04-241-1/+3
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Make the ShareAPIController strictRoeland Jago Douma2018-04-231-40/+39
|/ | | | | | | | 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>
* Move common menu templates to public APIJulius Härtl2018-04-051-2/+2
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* When formatting a share node an Empty target is invalidRoeland Jago Douma2018-04-041-1/+1
| | | | | | | | | | | 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>
* Set "share_with" field to the ID of the circleDaniel Calviño Sánchez2018-03-161-2/+10
| | | | | | | | | | | When a share is shared with a circle the "share_with" field returned by the API endpoint was always set to the name of the circle. However, the name is not enough to identify a circle. The Circles app now provides the ID of the circle in the "shared with" field of a Share, so this commit modifies the API endpoint to set the "share_with" field to the ID of the circle when provided by the Circles app. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* fixup! Sharing: redirect to download after authentification if requestedJohn Molakvoæ (skjnldsv)2018-03-011-1/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Fixed testsJohn Molakvoæ (skjnldsv)2018-02-281-1/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* fixup! Sharing: redirect to download after authentification if requestedJohn Molakvoæ (skjnldsv)2018-02-281-2/+9
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Sharing: redirect to download after authentification if requestedJohn Molakvoæ (skjnldsv)2018-02-281-4/+7
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Merge pull request #7363 from nextcloud/default-share-permsMorris Jobke2018-02-271-28/+35
|\ | | | | Let the admin configure the default share permissions
| * share api: use default permission of no permission is givenBjoern Schiessle2018-02-271-28/+35
| | | | | | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* | Fix files_sharing testsJulius Härtl2018-02-271-1/+1
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Use PublicTemplateResponse for files_sharingJulius Härtl2018-02-271-1/+15
|/ | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Remove unused import statementsMorris Jobke2018-02-142-2/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Show open graph preview in WhatsAppRoeland Jago Douma2018-02-121-0/+11
| | | | | | | Whatsapp is picky about the size of the open graph images. So we do some special handling. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>