Commit Graph

897 Commits (feat/database/query-result-fetch-associative-fetch-num)

Author SHA1 Message Date
Robin Appelman bda8601648
cache the verification of the share mountpoint
after the initial verification this can only really be invalidated by a system mount (external/group/etc) being created at the share target since any normal file/folder creation will already conflict with the share

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-21 18:08:35 +07:00
Cyrille Bollu c6a5c07041 Adds a "Request password" button to the public share authentication page for shares
of type TYPE_EMAIL, when the "video verification" checkbox isn't checked. Users accessing
non-anonymous public shares (TYPE_EMAIL shares) can now request a temporary password themselves.

- Creates a migration step for the files_sharing app to add the 'password_expiration_time'
  attribute to the oc_shares table.
- Makes share temporary passwords' expiration time configurable via a system value.
- Adds a system config value to allow permanent share passwords

-Fixes a typo in a comment in apps/files_sharing/src/components/SharingEntryLink.vue

See https://github.com/nextcloud/server/issues/31005

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
2022-04-11 21:58:24 +07:00
Vincent Petry b8b4d247b4
Merge pull request #31194 from nextcloud/feat/allow-to-exclude-groups-from-password-enforcement
Allow to disable password policy enforcement for selected groups
2022-04-06 10:13:23 +07:00
Carl Schwan a29251e02d Allow to disable password policy enforcement for selected groups
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Co-authored-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-04-05 17:04:17 +07:00
Simon L 1ceb6cdb38
Merge pull request #31684 from nextcloud/user-share-permissions-merge
take permissions from multiple paths into account for share permissions
2022-04-05 17:37:46 +07:00
Robin Appelman 11a6887c7d
ensure user folder is created in ApiTest
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 15:40:31 +07:00
Robin Appelman 278b13155a
take permissions from multiple paths into account for share permissions
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-31 16:47:35 +07:00
Louis 47f1ba6ea6
Merge pull request #31240 from nextcloud/Valdnet-patch-3
l10n: Add a dot
2022-03-31 14:57:25 +07:00
Valdnet 806a49aba5
Fix test
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
2022-03-31 11:04:47 +07:00
Côme Chilliet 25e7374e80
Fix ILogger instances in application tests for core parameters
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:27 +07:00
Louis Chemineau 85a101987d Add test to spelling unification
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-03-21 11:04:04 +07:00
Robin Appelman d81713e5c1
simplify setup of circular SetupManager<->Manager
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:09 +07:00
Robin Appelman 22875bf367
move logic to decide what to setup to setupmanager
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:03 +07:00
Robin Appelman 1c468129af
adjust tests to new fs setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:29:59 +07:00
Robin Appelman ad10a33316
make share cache test resilient against skeleton files not being there
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-25 15:49:30 +07:00
Louis Chemineau da435b1e67 Support CRUD share permissions
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-02-15 11:54:17 +07:00
szaimen f0424378f6 Revert "Add non-breaking space in the file size"
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-02-10 10:35:19 +07:00
Carl Schwan 46c0ceb59c
Add non-breaking space in the file size
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-14 09:19:15 +07:00
Louis Chemineau 14e57bf70a Replace license information to SPDX expression
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-01-11 17:26:40 +07:00
Vincent Petry ce31914314
Remove inefficient fed share scanner
Remove scanAll which relies on the "shareinfo" endpoint that returns the
full cache tree.
The latter can become big for big shares and result in timeouts.
Furthermode, the full tree would be retrieved again for each and every
detected change which can become expensive quickly.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-01-10 11:33:28 +07:00
Côme Chilliet 37f8f7a5a1
Fix tests on PHP 8.1 for encryption, files_sharing, files_version,
files_trashbin and theming apps

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-16 09:43:29 +07:00
Joas Schilling d49ad7ea47
Limit more contact searches
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-08 18:58:54 +07:00
Joas Schilling fa036b2001
Move common logic to share manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-09 10:10:53 +07:00
Robin Appelman ef93d2ea1c
update tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-10-19 11:31:08 +07:00
John Molakvoæ 90b47ab7f0
Merge pull request #28764 from nextcloud/feat/sharing-link-event 2021-09-10 09:31:18 +07:00
John Molakvoæ c56c317d82
Emit event on link share action
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
2021-09-10 08:36:45 +07:00
Arthur Schiwon 27865d03c0
use specific email getter where necessary
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-09-09 19:23:05 +07:00
Robin Appelman 8597d9c7d4
add event for when a share is mounted
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-08-24 15:26:50 +07:00
Vincent Petry f6f2f63016
Fix remote share deletion when deleting user
When deleting a user, we should only delete the direct remote user
shares or the remote group based subshares.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-07-27 14:32:51 +07:00
Vincent Petry dac676c14e
Replace ILogger with LoggerInterface in remote share manager
Signed-off-by: Vincent Petry <vincent@nextcloud.com>

Co-authored-by: Carl Schwan <carl@carlschwan.eu>
2021-07-27 13:04:39 +07:00
Vincent Petry e67e90afce
Fix remote group share decline+accept code path
When declining a remote group share through the dialog that appears when
notifications are off, the mount point is now correctly saved when
re-accepting.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-07-27 12:20:03 +07:00
Vincent Petry e8f4a524a2
Fix external share manager with multiple user groups
Use query builder with proper matching for finding the group names.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-07-27 12:19:26 +07:00
Vincent Petry 15f41a6b72
Fix remote group share API interactions
Accepting and declining can now be done repeatedly on both the parent
group share and sub-share with the same effects.

Added unit tests to cover these cases, and also when the same operation
is repeated.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-07-27 12:19:26 +07:00
Vincent Petry cff8ae7ded
Add logging to external shares manager
Instead of just returning false, also log the exception to make
debugging database issues easier.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-07-27 12:19:24 +07:00
Vincent Petry 7130a98e47
Fix received federated group shares
Fix pending shares endpoint to consider user-specific sub-entries
for group shares whenever a share was accepted or declined.

Added unit test for adding remote group shares.

Fixed "removeUserShares" to not send a remote request as we never send
remote requests for group shares.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-07-27 12:19:23 +07:00
Julius Härtl 7179002600
Allow to get a local cloud id without going through the contacts manager
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-07-14 16:08:05 +07:00
szaimen 0c27faf711 Update "Sending password by Nextcloud Talk failed" sentence
Signed-off-by: szaimen <szaimen@e.mail.de>
2021-07-07 13:39:57 +07:00
Julius Härtl c0474ba364
Use product name in places where it is appropriate rather than the instance name
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-06-16 11:42:53 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Thomas Citharel 1c0d975654
Make dav respect disallowing sharing with groups
Closes #25390

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2021-05-26 11:19:59 +07:00
Morris Jobke f1dbabd910
Merge pull request #26727 from nextcloud/group-exclude-link-share
Add option to exclude groups from creating link shares
2021-05-21 15:35:39 +07:00
Valdnet 602448a05b
l10n: Unify spelling in test 2021-05-20 09:26:38 +07:00
Valdnet 0e39cef0d9
l10n: Unify spelling in test 2021-05-20 09:26:38 +07:00
Robin Appelman b1dca57a1c
load share settings from the share manager in more places
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-05-12 16:11:28 +07:00
Roeland Jago Douma 701294520a Add bruteforce protection to the shareinfo endpoint
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-05-12 09:34:45 +07:00
rakekniven 48f05158e5
Merge pull request #26784 from nextcloud/Valdnet-patch-8
l10n: Change to a capital letter
2021-04-28 10:11:32 +07:00
Valdnet c79aba9865
Change size of the letter in test 2021-04-28 08:57:53 +07:00
Joas Schilling df47445c01
Fix unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-27 14:34:32 +07:00
Vincent Petry 2650da70ca
Unit tests for federated share expiration date
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-04-15 10:02:03 +07:00
John Molakvoæ (skjnldsv) 3e624dc399
Bump js licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-03-31 12:17:18 +07:00
Vincent Petry 278a73789e
Map old account scope properties to new names
Use new scope values in settings page.
Adjust all consumers to use the new constants.
Map old scope values to new ones in account property getter.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-26 13:07:08 +07:00
John Molakvoæ 6ade109b60
Merge pull request #26194 from nextcloud/techdebt/noid/remove-duplicate-sharing-unit-integration-tests-group-permission
Remove duplicate unit test in sharing that checks for group permission updates
2021-03-18 16:37:29 +07:00
Morris Jobke b34035f845
Merge pull request #26193 from nextcloud/techdebt/noid/remove-sharing-duplicate-unit-integration-tests
Permission tests for the sharing are fully covered in sharing v1 integration tests
2021-03-18 11:34:15 +07:00
Morris Jobke d650de13a4
Remove duplicate unit test in sharing that checks for group permission updates
* it was skipped before anyways
* it is covered for example in build/integration/sharing_features/sharing-v1-part3.feature#L517-L548 (see 54f8f75f6f/build/integration/sharing_features/sharing-v1-part3.feature (L517-L548))
* more permission updates are tested in the webdav section, where an OCS API is called and the WebDAV response is checked for the properly changed permission

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-03-18 10:31:56 +07:00
Morris Jobke e6bd23acf9
Permission tests for the sharing are fully covered in sharing v1 integration tests
See build/integration/sharing_features/sharing-v1*.features for the exact same tests. Especially part3 that covers most of the different permission setups over webdav.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-03-18 10:15:42 +07:00
Morris Jobke 6401d88283
Merge pull request #25331 from nextcloud/fix-valid-storages-removed-when-cleaning-remote-storages
Fix valid storages removed when cleaning remote storages
2021-03-18 08:57:09 +07:00
Vincent Petry c6d2d8746c
Fix CS in CacheTest
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-16 11:43:53 +07:00
Vincent Petry e559afb8d4
Merge pull request #25136 from nextcloud/cachejail-search-filter
do cachejail search filtering in sql
2021-03-15 17:45:30 +07:00
dependabot-preview[bot] eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +07:00
Daniel Calviño Sánchez 9ccabff6ba Fix valid storages removed when cleaning remote storages
The remote URL of a share is always stored in the database with a
trailing slash. However, when a cloud ID is generated trailing slashes
are removed.

The ID of a remote storage is generated from the cloud ID, but the
"cleanup-remote-storage" command directly used the remote URL stored in
the database. Due to this, even if the remote storage was valid, its ID
did not match the ID of the remote share generated by the command and
ended being removed.

Now the command generates the ID of remote shares using the cloud ID
instead, just like done by the remote storage, so there is no longer a
mismatch.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-01-28 21:42:31 +07:00
Robin Appelman 5ae0be08b4
fix search in nested jails
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-01-26 15:30:54 +07:00
Morris Jobke d84e1f1951
Re-use fetched dependencies in lib/base.php
Reduces calls to DI container by reusing already fetched dependencies.

For status.php it went from 355 to 344.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-01-20 21:55:16 +07:00
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +07:00
Julius Härtl 102402bfcb
Show unique displayname context in the user share list entries
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-14 11:14:59 +07:00
Roeland Jago Douma 27fdc6575d
Merge pull request #24630 from nextcloud/enh/noid/unknown_named_parameter
Error: Unknown named parameter $remote_id
2020-12-10 16:02:19 +07:00
Roeland Jago Douma 3c693db0ca
Merge pull request #24605 from nextcloud/enh/share-deck
Add deck share provider support
2020-12-10 14:30:08 +07:00
Daniel Kesselberg 9e4d49d157
Fix variable name for test
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-12-10 10:19:48 +07:00
Julius Härtl c4ea37b8a1
Address minor comments
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-09 15:51:41 +07:00
Julius Härtl 676d2b7a94
Adjust mountprovider tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-09 13:20:26 +07:00
Julius Härtl aefe826202
Adjust default
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-08 16:06:10 +07:00
Roeland Jago Douma bbf66f8637
Harde CapabiltiesTest
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-12-07 15:44:04 +07:00
Morris Jobke 83a75c670b
Replace static call to Share::unshare with ShareManager->deleteShare in tests
And then cleanup all the code that is dead then...

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-11-30 09:51:18 +07:00
Arthur Schiwon 16a78f535a
set the display name of federated sharees from addressbook
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-11-24 11:30:11 +07:00
Roeland Jago Douma 220bc1f218
Make the expire shares cron job actually expire the shares
Right now we just delete the shares from the DB. Which is efficient
sure. But doesn't trigger any real cleanup. So no Admin audit entries or
any other post processing is done.

This makes sure we really trigger this.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-11-19 10:51:51 +07:00
Joas Schilling 8027dcbc6f
Don't leave cursors open when tests fail
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-09 12:28:17 +07:00
Morris Jobke 0390a90d70
Return correct error message on share download without read permission
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-26 16:22:27 +07:00
Morris Jobke 512d2edc35
SharedMountTest.php:367 is unreliable
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-16 00:36:23 +07:00
Richard Steinmetz 89f7e2ab64
Indicate preview availability in share api responses
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2020-10-13 14:12:42 +07:00
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +07:00
John Molakvoæ (skjnldsv) 6adb19b296
Show filename on share link download
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2020-09-17 19:55:47 +07:00
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +07:00
Georg Ehrke 5b26487f14
Expose status via Collaborators API
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
2020-08-14 17:04:52 +07:00
Morris Jobke 234b510652
Change PHPDoc type hint from PHPUnit_Framework_MockObject_MockObject to \PHPUnit\Framework\MockObject\MockObject
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-12 13:55:19 +07:00
blizzz a3d30bf4a2
Merge pull request #21954 from nextcloud/techdebt/noid/bootstrap-files_trashbin
Use IBootstrap for the files_trashbin app
2020-08-07 11:12:09 +07:00
Morris Jobke e84504c4d6
Use IBootstrap for the files_trashbin app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-23 22:03:14 +07:00
Morris Jobke 0763a17332
Move federated_share_added into a typed event
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-07-23 08:33:17 +07:00
Julius Härtl 217a69ebf9
Add BeforeTemplateRenderedEvent for files_sharing
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-07-15 13:55:26 +07:00
Robin Appelman 118965ad98
better cleanup in share tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-09 11:14:45 +07:00
Joas Schilling a2f34f46b2
Fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-24 18:13:37 +07:00
Joas Schilling 89ed2c37bf
Update share type constant usage
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-24 16:49:16 +07:00
Julius Härtl 8289565bc7
Fix share update test
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-05-15 08:19:31 +07:00
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +07:00
Julius Härtl 5646f7c761
Link shares have reshare permission if outgoing federated shares are enabled
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-04-21 14:35:29 +07:00
Joas Schilling 609b8aff12
Also disallow ; in remote urls
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-04-14 18:56:06 +07:00
Christoph Wurst 28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:54:27 +07:00
Christoph Wurst 1584c9ae9c
Add visibility to all methods and position of static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:51:06 +07: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 +07: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 +07: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 +07: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 +07:00