Commit Graph

207 Commits

Author SHA1 Message Date
Daniel Calviño Sánchez 4ee839d69c Add provider for room shares
The RoomShareProvider is provided by the Talk app, so it is necessary to
check whether the app is available or not, and also whether the class
itself exists or not (just in case an older version of the app that did
not have support yet for room shares is being used).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-08-08 14:25:43 +02:00
Daniel Calviño Sánchez d582a66bea Honour "sendPasswordByTalk" property in mail shares
When a password was set for a mail share an e-mail was sent to the
recipient with the password. Now the e-mail is no longer sent if the
password is meant to be sent by Talk.

However, before the e-mail was not sent when the share was updated but
the password was not changed. Now an e-mail is sent in that case too if
switching from a password sent by Talk to a password sent by mail.

On the other hand, when switching from a password sent by mail to a
password sent by Talk it is mandatory to change the password; otherwise
the recipient would already have access to the share without having to
call the sharer to verify her identity.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-07-24 13:56:29 +02:00
Daniel Calviño Sánchez 88600f4ecf Add "sendPasswordByTalk" property to shares
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-07-24 13:56:28 +02:00
Bjoern Schiessle eab4d96c4c
some small template fixes
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-21 15:02:19 +02:00
Bjoern Schiessle 94c7052482
allow 'note' to be null
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-21 15:02:19 +02:00
Bjoern Schiessle 2250dbec21
add a nice looking button as direct link to the sharre
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-21 15:02:19 +02:00
Bjoern Schiessle b56ccef564
add direct link to the file for user/group shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-21 15:02:18 +02:00
Bjoern Schiessle a29261175d
fix mail templates
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-21 15:02:18 +02:00
Bjoern Schiessle 73b88deeb8
add note to share object when reading it from the db
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-21 15:02:18 +02:00
Bjoern Schiessle c116d116fa
improve mail template and escape html code
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
Bjoern Schiessle c668c5b997
fix selection of share provider
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-12 19:42:36 +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
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 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 5cfe20675d
start implementing federated sharing 2.0
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:27 +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
Joas Schilling 226e63695f
Merge pull request #8026 from nextcloud/feature/noid/allow-custom-html-in-html-emails
Allow custom HTML in HTML Emails
2018-02-26 13:38:39 +01:00
Joas Schilling 339e320064
Fix existing usages
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-02-15 12:18:51 +01:00
Morris Jobke d3d045dd5c
Remove unused import statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-02-14 16:55:43 +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
Morris Jobke a661f043e1
Remove unneeded semicolon and parentheses
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 23:46:40 +01:00
Roeland Jago Douma 4596423b14
Do not instantiate node when not needed
Use the lazy functions is possible. This avoids getting the node if not
required.

Possible fix for #7751

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-01-09 19:51:50 +01:00
Joas Schilling 80b34f5f7d
Only in case of $currentAccess the array uses the id as index
Otherwise its a normal string[] with the user ids, in that
case the array_merge did it's job just fine, apart from it
not being deduplicated.
The array+array is only needed when the user id is the key,
so integer only user ids are kept as they are instead of being
reindexed.

Regression from 3820d6883d

Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-11-28 17:17:51 +01:00
Lukas Reschke 1c25919cf1
Proper handle null cases and default to true
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-11-27 09:38:39 +01:00
Lukas Reschke 56a2512581
Add support for `\OCP\Share\IShare::getMailSend` back
This adds back the support for `\OCP\Share\IShare::getMailSend`, one example is creating bulk shares via API which where previously blocking due to the share notification emails.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-11-27 09:38:39 +01:00
Joas Schilling 3820d6883d
Fix accesslist when a user has an ID only containting 0-9
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-11-14 17:21:16 +01:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Arthur Schiwon e2805f02aa
Merge branch 'master' into autocomplete-gui 2017-11-01 15:37:29 +01:00
Julius Härtl 4cfa1c66b8
Doc: Fix phpDoc issues
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2017-10-23 23:23:56 +02:00
Arthur Schiwon fd6daf8d19
AutoCompletion backend
* introduce a Controller for requests
* introduce result sorting mechanism
* extend Comments to retrieve commentors (actors) in a tree
* add commenters sorter
* add share recipients sorter

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-10-22 14:13:32 +02:00
Joas Schilling 3119fd41ce
Set the data from the template
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-10-18 15:12:03 +02:00
Joas Schilling 8b37fe7f65
Set the subject with the email template to allow theming
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-10-18 15:12:03 +02:00
Stephan Müller 86265320b8
do not show hyphen after instance name in emails if slogan does not exist
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-09-25 09:20:46 +02:00
Roeland Jago Douma ae1fdf73c2
Improve sharing pagination
Basically we did in almost all cases did a query to much.
This resulted in an extra query for each share type.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-09-15 19:44:19 +02:00
Joas Schilling 7e625a8d22
Use the language of the recipient for the share notification
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-09-08 10:48:16 +02:00
Joas Schilling 6dbb64c4a2
Merge setMetaData into constructor
This ensures that the meta data is set in the beginning

Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-09-04 15:07:41 +02:00
Morris Jobke 3cfe91bf0f
Add shareWith to email template metadata
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-08-29 16:09:25 +02:00
Morris Jobke be23f7e1de
Allow the expiration date to be set to null
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-08-28 17:49:16 +02:00
Morris Jobke 2bf15eda26 Merge pull request #6255 from nextcloud/email-meta-data
Add meta information to emails for better customisation
2017-08-26 18:53:52 +02:00
Joas Schilling 09747b296a
Add meta information to emails for better customisation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-08-24 17:54:22 +02:00
Maxence Lange 0459c03696 link to getShareByToken
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2017-08-20 15:21:58 +02:00
Roeland Jago Douma 4633717f04
Move pre_shared and post_shared events to EventDispatcher
* Now listeners for those events get proper share objects.
* Legacy hooks still fired
* Updated tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-08-03 15:14:29 +02:00
Lukas Reschke bc9eb59384
Use IUser
This is broken and will never work as the phan CI step pointed out.

Pro-tip of the day: Check why CI fails before merging 🙈

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-08-02 13:25:22 +02:00
Morris Jobke c43abe43b0 Send an email once a file/folder is shared with a user
* only if user has set an email address
* only for user shares (no group shares for now)

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-07-28 08:36:11 +02:00
Roeland Jago Douma 5f227bd93b
More phpstorm inspection fixes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-07-24 11:39:29 +02:00
Morris Jobke b1954bed97 Merge pull request #5797 from paulijar/share20-postUnshareFromSelf
Dispatch event postUnshareFromSelf when the recipient of a share unshares it
2017-07-21 09:32:49 +02:00
Pauli Järvinen 7c4a15f215 Emit hook postUnshareFromSelf when the recipient of a share unshares it
- This kind of hook signal used to be emitted in the old Share library but it was missing from Share 2.0

Signed-off-by: Pauli Järvinen <pauli.jarvinen@gmail.com>
2017-07-20 14:45:46 +03:00
Joas Schilling 3ff3c338c9 Merge pull request #5734 from nextcloud/only-readable-chars-in-share-tokens
Only use readable chars in Share Tokens
2017-07-19 16:40:18 +02:00
Lukas Reschke d8ec399454
Run phan over code base
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-07-19 10:28:11 +02:00
Joas Schilling 984933e586
Only use readable chars in Share Tokens
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-07-18 15:44:34 +02:00
Pauli Järvinen 8dce97a3e1 Fix emitting of legacy hook post_unshare
- When a file was unshared, the legacy hook pre_unshare fired twice and the hook post_unshare did not fire at all. This was obviously a copy-paste error.

Signed-off-by: Pauli Järvinen <pauli.jarvinen@gmail.com>
2017-07-16 13:13:15 +03:00
Maxence Lange 6e7be6acfd upstream
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
2017-07-11 13:21:24 +02:00
Jan-Christoph Borchardt fd63577089 Improve wording of various error messages
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
2017-06-21 14:51:59 -05:00
Jan-Philipp Litza 0b066d9297 Fix 500 Internal Server Error on writing
In some not yet completely determined configurations, the following error could occur while writing a file:

Error: Call to a member function getUsers() on null
    /var/www/nextcloud/lib/private/Share20/Manager.php - line 1277: OC\Share20\DefaultShareProvider->getAccessList(Array, true)
    /var/www/nextcloud/lib/private/Share20/ShareHelper.php - line 51: OC\Share20\Manager->getAccessList(Object(OC\Files\Node\Folder), true, true)
    /var/www/nextcloud/apps/activity/lib/FilesHooks.php - line 616: OC\Share20\ShareHelper->getPathsForAccessList(Object(OC\Files\Node\File))
    /var/www/nextcloud/apps/activity/lib/FilesHooks.php - line 196: OCA\Activity\FilesHooks->getUserPathsFromPath('/path/to/file', 'user')
    /var/www/nextcloud/apps/activity/lib/FilesHooks.php - line 157: OCA\Activity\FilesHooks->addNotificationsForFileAction('/path/to/file', 'file_changed', 'changed_self', 'changed_by')
    /var/www/nextcloud/apps/activity/lib/FilesHooksStatic.php - line 55: OCA\Activity\FilesHooks->fileUpdate('/path/to/file')
    /var/www/nextcloud/lib/private/legacy/hook.php - line 106: OCA\Activity\FilesHooksStatic fileUpdate(Array)
    /var/www/nextcloud/lib/private/Files/View.php - line 1245: OC_Hook emit('OC_Filesystem', 'post_update', Array)
    /var/www/nextcloud/lib/private/Files/View.php - line 1173: OC\Files\View->runHooks(Array, '/path/to/file', true)
    /var/www/nextcloud/lib/private/Files/View.php - line 679: OC\Files\View->basicOperation('file_put_conten...', '/path/to/file', Array, '<?xml version="...')
    /var/www/nextcloud/lib/private/Files/Node/File.php - line 64: OC\Files\View->file_put_contents('/path/to/file', '<?xml version="...')
    [...]

Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de>
2017-06-16 11:38:22 +02:00
Joas Schilling 0f8c1b13a3
Fix unknown share token
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-06-13 18:44:50 +02:00
Robin Appelman f707a40f19
filter missing groups in share provider
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-06-12 15:46:19 +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
Roeland Jago Douma 82c9eb1c56 Merge pull request #4462 from danxuliu/fix-sharing-password-protected-link
Fix sharing a password protected link
2017-04-25 14:12:44 +02:00
Daniel Calviño Sánchez faea890b87 Extract updateSharePasswordIfNeeded function
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-04-24 13:38:36 +02:00
Daniel Calviño Sánchez 51e658da2a Join if block to preceding if chain
If getShareType() returns "email" it can not also return "user", "group"
nor "link", so the if block can be added to the preceding if chain.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-04-24 13:17:46 +02:00
Daniel Calviño Sánchez dcc8cce28b Fix double hashing of shared link passwords
The plain text password for a shared links was hashed and, then, the
hashed password was hashed again and set as the final password. Due to
this the password introduced in the "Authenticate" page for the shared
link was always a wrong password, and thus the file could not be
accessed.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-04-24 11:33:07 +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
Bjoern Schiessle 972b4c04e2
respect password policy for auto generated passwords
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-20 16:33:26 +02:00
Bjoern Schiessle d8dcd72118
allow admin to enforce password on mail shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-20 16:33:26 +02:00
Roeland Jago Douma ae2db5e60d
Get proper accesslist for userFolder
If the accesslist is requested for a users root folder we should
properly construct the path

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-04-20 10:28:32 +02:00
Lukas Reschke 203ef88509
Add "Reply-To" on ShareByMailProvider mails
Fixes https://github.com/nextcloud/server/issues/4209

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-04-18 22:23:07 +02:00
Roeland Jago Douma b96297e9cc
Do not set full path if not currentAccess
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-04-13 12:58:53 +02:00
Joas Schilling f57ef55249
Add samples to the docs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-13 12:58:53 +02:00
Joas Schilling 29f2088a7b
Catch exceptions and use as many results as possible
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-13 12:58:53 +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 5b57bb955b
Fix default share provider
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-13 12:58:52 +02:00
Joas Schilling 2fcf334c6a
Fix tests for ShareHelper
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 cf7c320949
Also return the token
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
Roeland Jago Douma 97f8ca6595
Added ShareHelper
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-04-13 12:58:49 +02:00
Roeland Jago Douma 88299ec27c
Added to public interface
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-04-13 12:58:49 +02:00
Roeland Jago Douma 7dcc98eb20
Add owner to access list
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-04-13 12:58:49 +02:00
Roeland Jago Douma d84df15590
Add getAccessList to ShareManager
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-04-13 12:58:48 +02: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 3323d01db1
update unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-07 15:43:59 +02:00
Bjoern Schiessle dac6826ad7
setting to disable sending password by mail
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-03 10:29:33 +02:00
Bjoern Schiessle b84fd7c361
set expire date for all share types
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-03 10:29:32 +02:00
Bjoern Schiessle 3cc0d15f92
add secure drop functionallity to mail shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-03 10:29:32 +02:00
Bjoern Schiessle c191173d59
allow password protected mail shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-03 10:29:32 +02:00
Bjoern Schiessle 0d5147bd49
add new password column to the share table in order to set passwords for share by mails
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-03 10:20:49 +02:00
Joas Schilling 348d97dfd6 Merge pull request #3844 from nextcloud/unshare_event
Unshare event
2017-03-21 16:57:09 +01:00
Joas Schilling 35f6b8716e Merge pull request #3884 from nextcloud/downstream-26956
Skip null groups in group manager
2017-03-20 12:27:38 +01:00
Maxence Lange 69694012ab shares-circles
Signed-off-by: Maxence Lange <maxence@nextcloud.com>
2017-03-17 18:48:33 -01:00
Roeland Jago Douma 85601259fb
Add LegacyHooks
Use a helper class to listen to the eventDispatcher calls from the share
manager to emit the old \OC_Hooks

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-03-17 08:50:56 +01:00
Roeland Jago Douma 5c9baf4ae2
Add unshare event
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-03-17 08:41:34 +01:00
Vincent Petry 377fdf3860
Skip null groups in group manager (#26871) (#26956)
* Skip null groups in group manager (#26871)

* Skip null groups in group manager

* Also skip null groups in group manager's search function

* Add more group null checks in sharing code

* Add unit tests for null group safety in group manager

* Add unit tests for sharing code null group checks

* Added tests for null groups handling in sharing code

* Ignore moveShare optional repair in mount provider

In some cases, data is inconsistent in the oc_share table due to legacy
data. The mount provider might attempt to make it consistent but if the
target group does not exist any more it cannot work. In such case we
simply ignore the exception as it is not critical. Keeping the
exception would break user accounts as they would be unable to use
their filesystem.

* Adjust null group handing + tests

* Fix new group manager tests

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-17 00:07:03 -06:00
Andrius 708b62f223 Fix detecting deleted shares in object store
While using the object store, the shares, that are moved to trashbin were still detected as accessible and cause broken shares to be shown in file/folder listing.
2017-03-09 14:36:20 +02:00