Commit Graph

39 Commits

Author SHA1 Message Date
Christoph Wurst 1f7f93a695
Update license headers for Nextcloud 20 (again)
There are still lots of outdated headers, so time for another round of
updates.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-09-07 14:37:44 +02:00
Julius Härtl f96853a19c
Do not fail if share for mountpoint is no longer available
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-03 11:17:59 +02:00
Joas Schilling d4a4d5c6ef
When no user is logged in null is used
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-29 09:42:54 +02: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 +02:00
Joas Schilling 89ed2c37bf
Update share type constant usage
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-06-24 16:49:16 +02:00
Christoph Wurst 09a632242d
Do not only catch Exceptions but any Throwable during rmt share delete
When a remote share is deleted, we notify the remove instance. This may
trigger various error conditions, which we want to catch in order to
avoid undeletable shares. The try-catch, however, did only capture
exceptions, so things like TypeErrors were not caught and caused the
process to fail hard.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-06-02 09:21:09 +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 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 b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +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 e16321368f
Fixes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-18 16:11:03 +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
Morris Jobke 4b49e2eb52
Fix unnecessary boolean cast
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2019-03-06 10:12:58 +01:00
fretn 7efcd11b8e Fix for crashing occ files:scan
when $share === false then (int)$share['share_type'] will always be equal to (int)0

which results in following crash:

[root@server nextcloud] sudo -u apache php occ files:scan someuser
The current PHP memory limit is below the recommended value of 512MB.
Starting scan for user 1 out of 1 (someuser)
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\OCS\DiscoveryService::discover() must be of the type string, null given, called in /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php on line 382 and defined in /var/www/html/nextcloud/lib/private/OCS/DiscoveryService.php:65
Stack trace:
0 /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php(382): OC\OCS\DiscoveryService->discover(NULL, 'FEDERATED_SHARI...')
1 /var/www/html/nextcloud/apps/files_sharing/lib/External/Manager.php(527): OCA\Files_Sharing\External\Manager->sendFeedbackToRemote(NULL, NULL, NULL, 'decline')
2 /var/www/html/nextcloud/apps/files_sharing/lib/External/Storage.php(216): OCA\Files_Sharing\External\Manager->removeShare('files/Someth...')
3 [internal function]: OCA\Files_Sharing\External\Storage->checkStorageAvailability()
4 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(505): call_user_func_array(Array, Array)
5 [internal function]: OC\Files\Storage\Wrapper\Wrapper->__call('checkStorageAva...', Array)
6 /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(505): call_user_func_array(Array, Array)
7 /var/www/html/nextcloud/apps/files_sharing/lib/External/Scanner.php(89): OC\Files\Storage\Wrapper\Wrapper->__call('checkStorageAva...', Array)
8 /var/www/html/nextcloud/apps/files_sharing/lib/External/Scanner.php(44): OCA\Files_Sharing\External\Scanner->scanAll()
9 /var/www/html/nextcloud/lib/private/Files/Utils/Scanner.php(245): OCA\Files_Sharing\External\Scanner->scan('', true, 3)
10 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(172): OC\Files\Utils\Scanner->scan('/someuser', true, NULL)
11 /var/www/html/nextcloud/apps/files/lib/Command/Scan.php(249): OCA\Files\Command\Scan->scanFiles('someuser', '/someuser', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
12 /var/www/html/nextcloud/3rdparty/symfony/console/Command/Command.php(251): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
13 /var/www/html/nextcloud/core/Command/Base.php(162): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
14 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(946): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
15 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
16 /var/www/html/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
17 /var/www/html/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
18 /var/www/html/nextcloud/console.php(96): OC\Console\Application->run()
19 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
20 {main}[root@server nextcloud]

Signed-off-by: fretn <frederikdelaere+github@gmail.com>
2019-01-24 11:45:53 +01: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 7d2add622e
unshare from self
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:46 +02:00
Bjoern Schiessle f5a816262c
accept/decline group shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:46 +02:00
Bjoern Schiessle b23032e4c5
implement federated group shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-11 10:11:44 +02:00
Bjoern Schiessle 41a1528888
implement decline share
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:28 +02:00
Bjoern Schiessle bbce8c3ea1
adjust to latest api version
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:28 +02:00
Bjoern Schiessle db428ea547
send accept share notification (WIP)
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-07-02 11:29:27 +02:00
Morris Jobke eb51f06a3b
Use ::class statement instead of string
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-29 12:03:47 +01:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Morris Jobke 50fc5a1e25 Merge pull request #5823 from nextcloud/improve-error-handling
Improve error handling for accepting federated shares
2017-07-21 22:54:14 +02:00
Bjoern Schiessle e78040d250
improved error handling
check if table was updated successfully and only then send a notification
mail and return "true".

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-07-21 12:07:32 +02:00
Robin Appelman 7fa02905aa
still remove the federated share even if we cant notify the remote
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-07-17 14:19:44 +02:00
Joas Schilling b5beaf7ef4
Use the share_folder config for remote shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-06-13 14:30:25 +02:00
Daniel Hansson 119e8474b6 fix for sharing
Signed-off-by: Daniel Hansson <daniel@techandme.se>
2017-05-20 16:23:04 +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
Bjoern Schiessle 449011dae7
remove discovery manager in favour of the OCSDiscoveryService
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2017-04-11 15:04:01 +02:00
Roeland Jago Douma a1ed8207e9
HTTPHelper is deprecated
Use the IClientService instead
2016-08-24 21:30:39 +02:00
Joas Schilling 0215b004da
Update with robin 2016-07-21 18:13:58 +02:00
Joas Schilling 813f0a0f40
Fix apps/ 2016-07-21 18:13:57 +02:00
Robin Appelman 2a72eff9ee Fix getting the certificate bundle for dav external storage (#25274)
* Fix getting the certificate bundle for dav external storages

* Log the original exception in dav external storage
2016-06-27 22:26:43 +02:00
Lukas Reschke aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Joas Schilling 3a716ae91c
Move lib/ to PSR-4 2016-05-25 14:59:59 +02:00