Commit Graph

668 Commits

Author SHA1 Message Date
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 9365fd2534
fix external manager tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:30 +02:00
Morris Jobke a788f49114
Merge pull request #10046 from nextcloud/fix-getting-the-information-of-a-group-share-as-a-sharee
Fix getting the information of a group share as a sharee
2018-06-29 13:14:41 +02:00
Morris Jobke 326f07e756
Merge pull request #8854 from nextcloud/drop-old-sharing-code
Get rid of shareItem
2018-06-29 10:40:32 +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 58376db92e
Update SharingCheckMiddlewareTest
* They are handled now by the overal sharing public page middleware

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-20 08:53:37 +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 ff3f63fd47
Fix PublicPreviewControllerTests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-20 08:53:37 +02:00
Roeland Jago Douma 9fed7aa2da
Backends are legacy code as well and need to go
so no need to fix the tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-23 19:51:37 +02:00
Morris Jobke bc34a7f4e9
Get rid of shareItem
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-05-23 19:51:37 +02:00
Roeland Jago Douma 33b639d23c
Fix ExpiresSharesJobTest
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-23 19:12:02 +02:00
Roeland Jago Douma c5042f1545
Use node api
* delete old test that can't happen anymore since we check for a valid
node

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-23 19:10:11 +02:00
Roeland Jago Douma ea5393e9f8
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-05-01 15:20:20 +02:00
Roeland Jago Douma d379770cf2
Fix sharedfilelistSpec.js tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-26 16:34:24 +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
Julius Härtl 1624762d2f
Fix tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-04-05 15:40:58 +02:00
Roeland Jago Douma f4fd0224db
Do not use \OCP\DB anymore
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-26 14:40:23 +02:00
Roeland Jago Douma b93d26a209
Replace ContactsManager
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-13 22:18:38 +01:00
Tobia De Koninck 55b9a5d886
Remove OC_App::disable method
Signed-off-by: Tobia De Koninck <tobia@ledfan.be>
2018-03-06 10:45:20 +01:00
John Molakvoæ (skjnldsv) 3824e6f631
fixup! fixup! Sharing: redirect to download after authentification if requested
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-03-01 13:17:08 +01:00
John Molakvoæ (skjnldsv) 7bcc821642
fixup! Fixed tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-02-28 19:03:00 +01:00
John Molakvoæ (skjnldsv) 8c69d783e0
Fixed tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-02-28 17:35:42 +01:00
Morris Jobke 7bc3c2e057
Merge pull request #7363 from nextcloud/default-share-perms
Let the admin configure the default share permissions
2018-02-27 13:44:34 +01:00
Bjoern Schiessle 3285becdc1
fix unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-02-27 12:29:25 +01:00
Julius Härtl 4a1cbefc90
Fix files_sharing tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-02-27 12:25:53 +01:00
Joas Schilling bf2be08c9f
Fix risky tests without assertions
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-01-25 11:33:25 +01:00
Roeland Jago Douma 1e7b20f615
Remove IAppConfig::setValue
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-01-17 21:41:57 +01:00
Morris Jobke 55532f19d9
Cleanup OC_User and OCP\User
* mainly removes deprecated methods and old static code

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-16 18:39:11 +01:00
Daniel Calviño Sánchez b70b38ce31 Fix constructor spy in unit test with Sinon 4.1.3
When a constructor is spied using Sinon it is wrapped by a proxy
function, which calls the original constructor when invoked. When "new
Foo()" is executed a "Foo" object is created, "Foo" is invoked with the
object as "this", and the object is returned as the result of the whole
"new" expression.

Before Sinon 4.1.3 the proxy called the original constructor directly
using the "thisValue" of the spied call; "thisValue" was the object
created by the "new" operator that called the proxy. The proxy assigned
"thisValue" to "returnValue", so it was also the value returned by the
proxy and, in turn, the value returned by the whole "new" expression.

Since Sinon 4.1.3 (see pull request 1626) the proxy calls the original
constructor using "new" instead of directly. The "thisValue" created by
the outermost "new" (the one that called the proxy) is no longer used by
the original constructor; the internal "new" creates a new object, which
is the one passed to the original constructor and returned by the
internal "new" expression. This object is also the value returned by the
proxy ("returnValue") and, in turn, the value returned by the whole
outermost "new" expression.

Thus, now "returnValue" should be used instead of "thisValue" to get the
object created by the spied constructor.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-12-08 21:26:45 +01:00
Arthur Schiwon 077381c7b3
rip out obsolete recipientsDisplayName
also needs tests adjustements, and this also brings in natural sorting

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-11-23 13:32:14 +01:00
Arthur Schiwon 9d95391ff1
adjust tests and apply sorting
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-11-23 13:32:13 +01:00
Robin Appelman 56fd462718
Use the correct root for shared jail when the source storage is also a jail
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-11-10 17:03:27 +01:00
Morris Jobke 31c5c2a592
Change @georgehrke's email
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 20:38:59 +01:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Jan-Christoph Borchardt 4a3893b105
Merge pull request #6094 from nextcloud/sharedby-avatar
Show avatar instead of username for shared files
2017-11-02 14:51:17 +01:00
Arthur Schiwon 222d99fe96
adjust more js unit tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-11-02 13:51:08 +01:00
Arthur Schiwon e2805f02aa
Merge branch 'master' into autocomplete-gui 2017-11-01 15:37:29 +01:00
Arthur Schiwon 20e7a0c07b
fix sharerecipientssorter tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-10-27 16:03:37 +02:00
Morris Jobke c733cdaa65
Use ::class in test mocks of encryption app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-26 13:56:56 +02:00
Morris Jobke ab36980d20
Use ::class in test mocks of dav app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-26 10:16:12 +02:00
Morris Jobke 43e498844e
Use ::class in test mocks
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-24 17:45:32 +02:00
Morris Jobke f884e762bc
Use appmanager instead of OC_App for check for enabled app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-10-23 23:31:17 +02:00
Arthur Schiwon 8722458d2a
ensure that sorting is stable
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-10-22 14:13:37 +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
blizzz 2d62f97f1b Merge pull request #6328 from nextcloud/split-sharees-api-logic
Splits off the logic from sharees endpoint thus making it available from within Nc/via PHP.
2017-10-04 15:43:44 +02:00
Arthur Schiwon c43685e6fc
shareeAPIController unit test clean up and last fixes
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-09-26 23:10:25 +02:00
Arthur Schiwon f2c8e1ed2f
remove unused method
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-09-26 23:10:25 +02:00
Arthur Schiwon a7a651f4a4
move splitUserRemote unit tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2017-09-26 23:10:25 +02:00