Commit Graph

78 Commits

Author SHA1 Message Date
Morris Jobke e3a2d069ae
Remove unused use statement
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-05-08 07:42:00 +02:00
Robin Appelman 756fe45493
get only groupids in default share backend
instead of getting the full group object and then only using the id anyway

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-05-04 17:42:28 +02:00
Joas Schilling cde6d768de
Merge pull request #20181 from nextcloud/bugfix/noid/dont-break-on-path-null
Also bail out when the path is actually null
2020-04-14 18:56:58 +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 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 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
Joas Schilling 51d174a40b
Also bail out when the path is actually null
Apparently this can happen when a external mount was shared
that is later not available anymore

Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-03-26 13:49:47 +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
Joas Schilling c5bc317681
Make sure the default share provider does not execute for other things
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-01-28 16:00:03 +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 21d7383d95
Allow internal shares to have a default expiration date
* Needs admin UI
* Needs more checks
* Basics seem to work

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-27 14:33:11 +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 e16321368f
Fixes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-18 16:11:03 +01:00
Joas Schilling 520042bbd0
Allow to accept group shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-11-12 17:36:58 +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
Joas Schilling dcdbea54e6
Respect the accepted flag for group and user shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-11-12 17:13:38 +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
Julius Härtl 857fae288c
Always set the display name for user shares
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2019-07-03 21:34:18 +02:00
Roeland Jago Douma 977e3959eb
Do not update child all child shares on group share update
Else we overwrite the whole share for link shares. Basically breaking
them.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-04 20:55:14 +01:00
Roeland Jago Douma 72b7c9ffa0
Merge pull request #12105 from nextcloud/using-resharing-right-to-display-shares
Shares are displayed to users with resharing rights
2018-11-04 21:08:11 +01:00
Maxence Lange 77b95ccd12
revert tests
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2018-11-02 12:10:49 +01:00
Maxence Lange 68c44bb642
shares are displayed to users with resharing rights
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2018-11-02 12:09:26 +01:00
Daniel Calviño Sánchez fe8a67f517 Store "sendPasswordByTalk" property of link shares in the database
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-11-02 01:57:48 +01:00
Bjoern Schiessle 5e90711600 allow to update lables for public link shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-11-01 02:18:55 +01:00
Bjoern Schiessle f377a61f90 allow to add labels to shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-11-01 02:15:07 +01:00
Roeland Jago Douma abbb946bbb Propegate hide download state in share provider
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-30 15:18:55 +01: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 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
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
Morris Jobke d3d045dd5c
Remove unused import statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-02-14 16:55:43 +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
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
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01: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
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
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
Morris Jobke c54a59d51e
Remove unused use statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-22 19:23:31 -05: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