summaryrefslogtreecommitdiffstats
path: root/tests/lib/Share20
Commit message (Collapse)AuthorAgeFilesLines
* Make phpunit8 compatibleRoeland Jago Douma2019-11-275-6/+6
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add typed events for password_policyChristoph Wurst2019-11-271-25/+30
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Some php-cs fixesRoeland Jago Douma2019-11-225-14/+19
| | | | | | | | | | | * 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>
* Add unit tests for "getAllShares()"Daniel Calviño Sánchez2019-10-302-0/+216
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix permission check on incoming federated sharesJulius Härtl2019-07-311-0/+33
| | | | | | | | Since federated shares have their permissions set on the node, we do not need to check for parent share permissions. Otherwise reshares of incoming federated have no permission variable defined and creating them will fail Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Always set the display name for user sharesJulius Härtl2019-07-031-0/+9
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Unify the permission checking in one place onlyJoas Schilling2019-07-031-4/+9
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Better check reshare permissions when creating a shareJoas Schilling2019-07-031-0/+6
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add event dispatcher to OCPChristoph Wurst2019-06-251-4/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Correctly determinate the owner in case of shared external storagesJoas Schilling2019-02-181-16/+30
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Remove deprecated functions from SecureRandomRoeland Jago Douma2018-12-071-4/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix typo in "incoming"Joas Schilling2018-12-051-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Store "sendPasswordByTalk" property of link shares in the databaseDaniel Calviño Sánchez2018-11-021-0/+9
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix update share testsDaniel Calviño Sánchez2018-11-021-2/+50
| | | | | | | | | | | | | | | | | | | The update share tests only checked that the share returned by "update()" had the expected values. However, as "update()" returns the same share that was given as a parameter the tests were not really verifying that the values were updated in the database. In a similar way, the test that checked that a password was removed did not set a password first, so even if the database returned null it could be simply returning the default value for the share; a password must be set first to ensure that it is removed. Besides that, a typo was fixed too that made the checks on the original share instead of on the one returned by "update()"; right now it is the same share, so the change makes no difference, but it is how the check should be done anyway. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add support for tokens in room sharesDaniel Calviño Sánchez2018-08-081-0/+50
| | | | | | | | | | Tokens will be used to give access to a share to guests in public rooms. Although the token itself is created in the provider of room shares and no changes are needed for that, due to the code structure it is necessary to explicitly call the provider from the manager when getting a room share by token. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Honour "sendPasswordByTalk" property in mail sharesDaniel Calviño Sánchez2018-07-241-0/+436
| | | | | | | | | | | | | | | | | 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>
* fix unit testsBjoern Schiessle2018-07-211-4/+48
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* testsMaxence Lange2018-05-211-0/+17
| | | | Signed-off-by: Maxence Lange <maxence@nextcloud.com>
* Fix risky tests without assertionsJoas Schilling2018-01-251-0/+11
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix current access list test and add one for $currentAccess === falseJoas Schilling2017-11-281-2/+113
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Use the language of the recipient for the share notificationJoas Schilling2017-09-081-0/+11
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Move pre_shared and post_shared events to EventDispatcherRoeland Jago Douma2017-08-032-86/+237
| | | | | | | | * Now listeners for those events get proper share objects. * Legacy hooks still fired * Updated tests Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Send an email once a file/folder is shared with a userMorris Jobke2017-07-281-7/+40
| | | | | | | * 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>
* Emit hook postUnshareFromSelf when the recipient of a share unshares itPauli Järvinen2017-07-202-0/+86
| | | | | | - 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>
* Fix emitting of legacy hook post_unsharePauli Järvinen2017-07-161-1/+1
| | | | | | - 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>
* Improve wording of various error messagesJan-Christoph Borchardt2017-06-211-22/+22
| | | | Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
* Fix unknown share tokenJoas Schilling2017-06-131-0/+5
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add missing unit test for updateShare with email shareDaniel Calviño Sánchez2017-04-241-0/+75
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add missing hook checkDaniel Calviño Sánchez2017-04-241-2/+13
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix double hashing of shared link passwordsDaniel Calviño Sánchez2017-04-241-0/+6
| | | | | | | | | | 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>
* Get proper accesslist for userFolderRoeland Jago Douma2017-04-201-2/+1
| | | | | | | 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>
* Add more tests for the share helperJoas Schilling2017-04-131-0/+111
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Activate the testJoas Schilling2017-04-131-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Adjust docs and make !$currentAccess simplerJoas Schilling2017-04-131-4/+12
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix share manager testJoas Schilling2017-04-131-13/+24
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix default share providerJoas Schilling2017-04-131-10/+10
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix tests for ShareHelperJoas Schilling2017-04-131-44/+70
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add shareHelper testRoeland Jago Douma2017-04-131-0/+94
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add mail element to access listRoeland Jago Douma2017-04-132-4/+0
| | | | | | | | * 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>
* Offload acceslist creation to providersRoeland Jago Douma2017-04-132-41/+232
| | | | | | | | * 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>
* Fix testsRoeland Jago Douma2017-04-131-0/+6
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add owner to access listRoeland Jago Douma2017-04-131-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add getAccessList to ShareManagerRoeland Jago Douma2017-04-131-1/+82
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* update unit testsBjoern Schiessle2017-04-071-7/+10
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Merge pull request #3844 from nextcloud/unshare_eventJoas Schilling2017-03-212-171/+189
|\ | | | | Unshare event
| * Add LegacyHooksRoeland Jago Douma2017-03-172-171/+189
| | | | | | | | | | | | | | 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>
* | Merge pull request #3884 from nextcloud/downstream-26956Joas Schilling2017-03-202-0/+115
|\ \ | | | | | | Skip null groups in group manager
| * | Skip null groups in group manager (#26871) (#26956)Vincent Petry2017-03-172-0/+115
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* / shares-circlesMaxence Lange2017-03-171-1/+1
|/ | | Signed-off-by: Maxence Lange <maxence@nextcloud.com>
* also create mail share if public links are disabledBjoern Schiessle2017-01-041-0/+110
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>