aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Share20
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix language in share notes email for usersJoas Schilling2020-06-231-12/+29
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Prevent harder to share your rootJoas Schilling2020-06-031-2/+4
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix disabling send password by Talk without new password in mail sharesDaniel Calviño Sánchez2020-05-291-5/+79
| | | | | | | | | | | | | | | | | | When "send password by Talk" was disabled in a mail share it was possible to keep the same password as before, as it does not pose any security issue (unlike keeping it when "send password by Talk" is enabled, as in that case the password was already disclosed by mail). However, if a mail share is updated but the password is not set again only the hashed password will be available. In that case it would not make sense to send the password by mail, so now the password must be changed when disabling "send password by Talk". Note that, even if explicitly setting the same password again along with the "send password by Talk" property would work, this was also prevented for simplicity. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix enabling send password by Talk with same password in mail sharesDaniel Calviño Sánchez2020-05-281-4/+96
| | | | | | | | | | | | | When "send password by Talk" is enabled in a mail share a new password must be also set. However, when the passwords of the original and the new share were compared it was not taken into account that the original password is now hashed, while the new one is not (unless no new password was sent, in which case the password of the original share was set in the new share by the controller, but that was already prevented due to both passwords being literally the same), so it was possible to set the same password again. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix enabling send password by Talk with empty password in link sharesDaniel Calviño Sánchez2020-05-281-0/+69
| | | | | | | When "send password by Talk" is enabled in a link share now a non empty password is enforced. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Adjust tests to only return group IDsMorris Jobke2020-05-081-32/+15
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #19793 from nextcloud/bugfix/noid/link-to-federated-reshareMorris Jobke2020-04-271-18/+0
|\ | | | | Fix resharing of federated shares that were created out of links
| * Remove unneeded test since links have resharing permissions by defaultJulius Härtl2020-04-211-18/+0
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Allow specifying a default expiration dateRoeland Jago Douma2020-04-241-0/+1
|/ | | | | | This overrides the max expiration date. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-102-43/+69
| | | | | | | | | | | | | | | 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>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-092-31/+31
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix (array) indent style to always use one tabChristoph Wurst2020-04-092-13/+13
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the shorter phpunit syntax for mocked return valuesChristoph Wurst2020-03-253-189/+189
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Strip of users home path from share api messageJoas Schilling2020-02-201-0/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* config.php setting to always accept internal sharesRoeland Jago Douma2019-12-161-43/+57
| | | | | | Part of #18255 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #17725 from nextcloud/enh/share_exp_internalRoeland Jago Douma2019-11-281-1/+2
|\ | | | | Allow internal shares to have a default expiration date
| * Fix testsRoeland Jago Douma2019-11-271-1/+2
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Mode to modern phpunitRoeland Jago Douma2019-11-275-173/+173
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Fix more testsRoeland Jago Douma2019-11-271-2/+2
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | 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>