Commit Graph

69 Commits

Author SHA1 Message Date
Vincent Petry 5f405e1454
Fix loading order for OCS endpoints
The loading order can have side effects in the way how apps register
plugins, listeners, etc.

Recently the order had been changed as part of cleaning up old code, but
caused apps to break.

This brings back the old app loading order to guarantee that apps won't
break, even though it might not semantically make sense.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2020-12-10 08:20:20 +01:00
Roeland Jago Douma 72a9c35be3
Remove some IRouter methods
This is not the end. IRouter needs to burn.
But it is a start.

🎵 we didn't start the fire 🎵

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-11-17 14:08:20 +01:00
Roeland Jago Douma 3831d8f57f
Remove the matching on ancient /ocs routes
The appframework has been the default for quite some time now. So time
to take proper advantage of it.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-10-31 12:12:03 +01: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 +02:00
Christoph Wurst 94a95ffceb
Fix invalid usage of \Exception::getResult
Only OCS exceptions have a getResult method. Any other exception will
cause another error due to this invalid method call.

This splits the catch into a specific one for OCS and then a generic one
for anything else that can't be handled.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-06-16 15:37:20 +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 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Joas Schilling 0c77cd21f9
Make sure maintenance mode is always casted to bool
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-22 08:25:41 +01:00
Julius Härtl 3e21033dfc
Fix undefined constant error for STATUS_SERVICE_UNAVAILABLE
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-07-26 22:56:17 +02:00
Morris Jobke 79d9841bce
Replace hardcoded status headers with calls to http_response_code()
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-06-26 16:14:15 +02:00
Roeland Jago Douma e628424ccf
Warn about the old OCP\API::register construct for OCS
* Add sleep
* Add log message

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-01-17 15:18:22 +01:00
Morris Jobke ca74a54dfa
Remove "DEBUG OUTPUT:" from failing OCS API requests
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-09 18:34:25 +01:00
Roeland Jago Douma b8af7ee9bc
Nextcloud 13 is not compatible with newer than php 7.2
Just to avoid users from trying this with a to new (untested) php version

* Moved the check logic to 1 place
* All directly callable scripts just require this on top
* exit hard (-1) so we know scripts won't continue
* Return status 500 so no sync clients will try fancy stuff

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-12-12 10:55:09 +01:00
Roeland Jago Douma 87e10f9e6a
OC_OCS_Response is deprecated
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-09-21 17:56:00 +02:00
Joas Schilling 9f3d9b5b23
Don't force the use of Accept-Language anymore
This is not intended anymore, since it falls back to force english
when the header is not set. Also 0228bc6e66
makes clear that the order should be:

1. User setting
2. Accept language
3. Admin default

This is the case since the commit from above, unless via OCS and DAV.
Both forced to accept-language falling back to english.
By removing the force, it now also matches the w3 priority list:
https://www.w3.org/International/questions/qa-lang-priorities

Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-04-07 11:10:04 +02:00
Morris Jobke 6174a514b7
Get rid of static OCS::notFound()
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-03 00:41:21 -06:00
Morris Jobke 9533f4e5ed
Clean up single user mode
Single user mode basically disables WebDAV, OCS and cron execution. Since
we heavily rely on WebDAV and OCS also in the web UI it's basically useless.
An admin only sees a broken interface and can't even change any settings nor
sees any files. Also sharing is not possible.

As this is at least the case since Nextcloud 9 and we haven't received any
reports for this it seems that this feature is not used at all so I removed it.

The encryption commands now rely on the well tested maintenance mode.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-02-22 23:02:31 -06:00
Robin Appelman e7e614d801
log ocs exceptions
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-02-08 15:17:03 +01:00
Vincent Petry 00f135d320
Die in OCS v1.php on exception
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-12-16 17:35:42 +01:00
Joas Schilling f3319f6294
Allow to call the files even when you are in another instance atm
Signed-off-by: Joas Schilling <coding@schilljs.com>
2016-10-06 12:15:13 +02:00
Roeland Jago Douma 8ae49183c1
Catch LoginException 2016-07-22 11:43:47 +02:00
Joas Schilling 0215b004da
Update with robin 2016-07-21 18:13:58 +02:00
Joas Schilling ba87db3fcc
Fix others 2016-07-21 18:13:57 +02:00
Lukas Reschke c90a71a83b
Only login if user is not logged-in 2016-07-18 11:09:50 +02:00
Roeland Jago Douma 1caceea6c0
Make the OCS endpoint handle the new OCS AppFramework routes 2016-07-18 11:09:45 +02:00
Christoph Wurst d36a1fed3e load authentication apps first (#25126)
* load authentication apps first

* load session apps before all other apps
2016-06-16 11:32:28 +02:00
Lukas Reschke aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Lukas Reschke 933f60e314 Update author information
Probably nice for the people that contributed to 9.0 to see themselves in the AUTHORS file :)
2016-03-01 17:25:15 +01:00
Joas Schilling 043625ee52 Move findLanguage() and setLanguageFromRequest() to factory 2016-01-26 14:02:31 +01:00
Thomas Müller 682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Morris Jobke b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Thomas Müller 3358db320b Reduce duplicate code 2015-08-03 18:06:07 +02:00
Morris Jobke f63915d0c8 update license headers and authors 2015-06-25 14:13:49 +02:00
Robin Appelman a7aba07dc1 block ocs in single user mode 2015-04-09 15:57:27 +02:00
Joas Schilling f7dd16f1ac Disable OCS api when in maintenance mode 2015-04-08 12:51:20 +02:00
Jenkins for ownCloud b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Thomas Müller 2367797c17 Respect http header 'Accept-Language' on ocs and remote.php calls 2015-03-09 10:38:38 +01:00
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +01:00
Jenkins for ownCloud 6a1a4880f0 Updating license headers 2015-02-23 12:13:59 +01:00
Lukas Reschke 886bda5f81 Refactor OC_Request into TrustedDomainHelper and IRequest
This changeset removes the static class `OC_Request` and moves the functions either into `IRequest` which is accessible via `\OC::$server::->getRequest()` or into a separated `TrustedDomainHelper` class for some helper methods which should not be publicly exposed.

This changes only internal methods and nothing on the public API. Some public functions in `util.php` have been deprecated though in favour of the new non-static functions.

Unfortunately some part of this code uses things like `__DIR__` and thus is not completely unit-testable. Where tests where possible they ahve been added though.

Fixes https://github.com/owncloud/core/issues/13976 which was requested in https://github.com/owncloud/core/pull/13973#issuecomment-73492969
2015-02-16 22:13:00 +01:00
Vincent Petry 972fffbe02 Return 503 OCS response with requested format 2014-06-30 15:37:38 +02:00
Vincent Petry 2e45eb8ad6 Return 503 in public.php and OCS API when upgrade is due
To prevent unexpected behavior, public.php and the OCS API calls will
return 503 Service Unavailable when an upgrade is due.
2014-06-30 14:48:03 +02:00
Thomas Müller 596177727a OCS API calls will always return English messages 2014-04-15 15:32:08 +02:00
Thomas Müller 6ff96b34ad Merge branch 'master' into load-apps-proper-master
Conflicts:
	apps/files/ajax/rawlist.php
	cron.php
	ocs/v1.php
2014-03-21 14:05:08 +01:00
Thomas Müller 756bbe8786 Merge pull request #7649 from owncloud/routing-public
Move routing classes to an interface and expose it in the public api
2014-03-17 21:07:05 +01:00
Thomas Müller 88f6dd7db1 fixing method names 2014-03-12 10:00:22 +01:00
Thomas Müller 743addd1e3 set content-type on ocs exceptions 2014-03-12 00:35:19 +01:00
Robin Appelman 26793e1f94 switch OC::getRouter usages to OC::$server->getRouter 2014-03-10 14:06:47 +01:00
Thomas Müller 8f5c641cd8 load all apps in ocs/v1.php 2014-02-18 14:51:59 +01:00
Bart Visscher 22d759964f Use raw PathInfo for matching urls 2013-06-28 17:25:36 +02:00