Commit Graph

1118 Commits

Author SHA1 Message Date
Thomas Müller 35b97ed672 Adding renameKeys to IStorage 2015-04-07 13:30:29 +02:00
Thomas Müller bf809ac85a Removing left overs from old encryption app 2015-04-07 13:30:29 +02:00
Thomas Müller 6ccd3ffa23 adding function getSecureRandom(); to IServerContainer 2015-04-07 13:30:29 +02:00
Bjoern Schiessle a85e2e0bfd make recovery settings work 2015-04-07 13:30:28 +02:00
Bjoern Schiessle 2244ea998d core: documentation fixes 2015-04-07 13:30:27 +02:00
Bjoern Schiessle 506222567e add deleteKey methods to key storage 2015-04-07 13:30:27 +02:00
Bjoern Schiessle 5bc9ababeb fix keystorage and add unit tests 2015-04-07 13:30:27 +02:00
Clark Tomlinson 39733c8da1 Initial commit 2015-04-07 13:30:27 +02:00
Bjoern Schiessle 63e7fe608a create basic interfaces and wrapper to make encryption more modular 2015-04-07 13:30:27 +02:00
Joas Schilling 3bde7c2f67 When guessing the timezone, the offset might only be valid on a given timestamp 2015-04-07 10:13:06 +02:00
Thomas Müller 3bf269e565 Merge pull request #15229 from owncloud/response-setContentLengthHeader
Add OC_Response::setContentLengthHeader() for Apache PHP SAPI workaround...
2015-04-03 22:51:36 +02:00
Lukas Reschke 0816cf9142 Add experimental applications switch
Allows administrators to disable or enabled experimental applications as well as show the trust level.
2015-04-03 13:21:24 +02:00
Roeland Jago Douma 288da619b1 Deprecate functions that only call the urlgenerator anyway 2015-04-01 14:32:49 +02:00
Joas Schilling 730efe25a4 Make scrutinizer happy 2015-04-01 12:13:49 +02:00
Joas Schilling b95d12700c Add logic for getting the user from the rss token to the Manager 2015-03-30 15:23:09 +02:00
Roeland Jago Douma b0aa17b13f OCS Fixes to allow setting of password without removing additional settings
- Added setPassword to share.php
- Fixed OCS API call
- Added unit tests
2015-03-30 14:00:50 +02:00
Vincent Petry a32c71d25e Revert "Deprecated \OCP\IAppConfig - add missing methods to IConfig"
This reverts commit 012016d331.
2015-03-27 18:50:11 +01:00
Thomas Müller 4d12c4a38b Merge pull request #13938 from owncloud/deprecate-iappconfig
Deprecated \OCP\IAppConfig - add missing methods to IConfig
2015-03-27 16:07:41 +01:00
Bjoern Schiessle b5fad75e57 add deleteAllFileKeys to public interface and add "uid" as parameter for the
update call
2015-03-27 11:51:53 +01:00
Thomas Müller 232518ac54 Merge pull request #15234 from owncloud/encryption2_core
core part of encryption 2.0
2015-03-26 21:14:59 +01:00
Bjoern Schiessle ff9c85ce60 implement basic encryption functionallity in core to enable multiple encryption modules 2015-03-26 20:56:51 +01:00
Andreas Fischer 0f58315543 Add OC_Response::setContentLengthHeader() for Apache PHP SAPI workaround.
Do not send Content-Length headers with a value larger than PHP_INT_MAX
(2147483647) on Apache PHP SAPI 32-bit. PHP will eat them and send 2147483647
instead.

When X-Sendfile is enabled, Apache will send a correct Content-Length header,
even for files larger than 2147483647 bytes. When X-Sendfile is not enabled,
ownCloud will not send a Content-Length header. This prevents progress bars
from working, but allows the actual transfer to work properly.
2015-03-26 16:37:38 +01:00
Jenkins for ownCloud b585d87d9d Update license headers 2015-03-26 11:44:36 +01:00
Lukas Reschke 5f044ebf1b Add wrapper for Guzzle 2015-03-25 16:04:41 +01:00
Lukas Reschke 5a9c9b86f8 Merge pull request #15153 from owncloud/uniquename-node
Add `getNonExistingName()` to the node api
2015-03-24 15:51:12 +01:00
Robin Appelman d11f01fa0f Add `getNonExistingName()` to the node api 2015-03-24 15:00:36 +01:00
Lukas Reschke e2453d78c0 Properly catch whether a share is `null`
Despite it's PHPDoc the function might return `null` which was not properly catched and thus in some situations the share was resolved to the sharing users root directory.

To test this perform the following steps:

* Share file in owncloud 7 (7.0.4.2)
* Delete the parent folder of the shared file
* The share stays is in the DB and the share via the sharelink is inaccessible. (which is good)
* Upgrade to owncloud 8 (8.0.2) (This step is crucial. The bug is not reproduceable without upgrading from 7 to 8. It seems like the old tokens are handled different than the newer ones)
* Optional Step: Logout, Reset Browser Session, etc.
* Access the share via the old share url: almost empty page, but there is a dowload button which adds a "/download" to the URL.
* Upon clicking, a download.zip is downloaded which contains EVERYTHING from the owncloud directory (of the user who shared the file)
* No exception is thrown and no error is logged.

This will add a check whether the share is a valid one and also adds unit tests to prevent further regressions in the future. Needs to be backported to ownCloud 8.

Adding a proper clean-up of the orphaned shares is out-of-scope and would probably require some kind of FK or so.

Fixes https://github.com/owncloud/core/issues/15097
2015-03-24 11:21:58 +01:00
Thomas Müller afa8872955 Merge pull request #14857 from owncloud/preview-provider-registration-in-manager
Preview provider registration in manager
2015-03-20 16:34:22 +01:00
Bernhard Posselt df24a014b8 If the execute method on the mapper receives an assoc array, it binds by value instead of index 2015-03-19 17:08:46 +01:00
Thomas Müller 3765af4edf Merge pull request #14986 from owncloud/fixmapperbackw
Fix backwards compatibility for mapper execute method
2015-03-19 17:04:01 +01:00
Robin Appelman 73874ca27f Merge pull request #14704 from owncloud/storage-wrapper-mount
pass mountpoint to storage wrapper callback
2015-03-19 16:20:38 +01:00
Bernhard Posselt f77ae37f23 also use backwards compatible method for mapper 2015-03-18 22:20:23 +01:00
Bernhard Posselt c52bd10361 fix backwards compatibility for mapper execute method 2015-03-18 09:25:22 +01:00
Morris Jobke 012016d331 Deprecated \OCP\IAppConfig - add missing methods to IConfig 2015-03-17 17:19:33 +01:00
Joas Schilling 9c45ab49a1 Use a closure for the files app entry and deprecate old methods 2015-03-17 12:17:09 +01:00
Lukas Reschke e4c6b0abf5 Merge pull request #14931 from owncloud/issue/14881-closures-for-navigation-entries
Issue/14881 closures for navigation entries
2015-03-17 11:28:27 +01:00
Lukas Reschke b1c19f74a1 Merge pull request #12085 from owncloud/add-swift-mailer
Migrate OC_Mail to SwiftMailer
2015-03-17 11:15:39 +01:00
Joas Schilling 970846624f Allow registering closures for navigation entries
This speeds up all pages that don't use the navigation by 0.04sec per app,
because we don't need to create the routing anymore, unless we really need to.
2015-03-16 16:17:43 +01:00
Joas Schilling c2a5bd6a01 Also add a note that clob does not work in the compare array 2015-03-16 15:41:00 +01:00
Lukas Reschke 7a70fffa6c Don't fallback to Plaintext per default for legacy class 2015-03-16 14:10:03 +01:00
Joas Schilling 8f06353882 Remove load*() methods from public interface
We shall add a factory for that in the future
2015-03-16 12:57:15 +01:00
Lukas Reschke f92f3a1a6e Incorporate review changes 2015-03-16 12:47:05 +01:00
Lukas Reschke 13486a5ada Migrate to SwiftMail
Replaces the OC_Mail and phpmailer with SwiftMail allowing us to mock it properly.

Fixes the unit test execution on master on local machines and https://github.com/owncloud/core/issues/12014

Conflicts:
	3rdparty
	lib/private/server.php
	lib/public/iservercontainer.php
	tests/lib/mail.php
	tests/settings/controller/mailsettingscontrollertest.php

Conflicts:
	3rdparty
	lib/private/mail.php
	lib/private/server.php
	lib/public/iservercontainer.php
	settings/ajax/lostpassword.php
	settings/application.php
2015-03-16 12:47:05 +01:00
Joas Schilling 8ed27d2ce0 Create an interface for OC_Image and OCP\Image for the public API 2015-03-16 12:45:15 +01:00
Joas Schilling e518eacba6 Add more type hinting 2015-03-16 12:44:11 +01:00
Joas Schilling c1f266db88 Add an interface for the preview providers 2015-03-16 12:44:11 +01:00
Joas Schilling 227ff0a9e3 Clean up some docs 2015-03-16 12:44:11 +01:00
Joas Schilling 0b37d5aea3 Move default provider registration to preview manager 2015-03-16 12:44:11 +01:00
Joas Schilling cae8529359 Register preview providers on the preview manager instead of OC\Preview 2015-03-16 12:44:11 +01:00
Morris Jobke 997a7a2668 Merge pull request #14766 from owncloud/fix-insertifnotexists-poc
Allow specifying the compare-array for insertIfNotExists()
2015-03-16 10:31:36 +01:00
Thomas Müller 6927773648 Merge pull request #14776 from owncloud/fix-14629-master
verify the file name length not to exceed 255 characters + verify path d...
2015-03-16 09:58:41 +01:00
Lukas Reschke 38fec9b095 Can also be null
If the user does not exist this returns null and can lead to nasty bugs since the IDE is not indicating this...
2015-03-13 14:01:24 +01:00
Thomas Müller 80ef53eff0 verify the file name length not to exceed 255 characters + verify path during rename 2015-03-12 10:47:47 +01:00
Roeland Jago Douma 1a0f9c375b Avatar controller moved to AppFrameWork
* Original avatarcontroller migrated to the appframework
* Added DataDisplayResponse that show data inline in the browser (used
  to retrun the image)
* Removed some unneeded code
* Added unit tests for the avatarcontroller
2015-03-11 16:37:42 +01:00
Robin Appelman 4f0f175f8b Allow getting all mount options as array 2015-03-11 15:06:12 +01:00
Robin Appelman e5c8fd37df pass mountpoint to storage wrapper callback 2015-03-11 15:06:12 +01:00
Joas Schilling d1511cdbee Fix doc blocks of insertIfNotExists() method 2015-03-11 09:05:30 +01:00
Lukas Reschke 6dc59019af Merge pull request #14346 from owncloud/storage-based-path-validation
adding storage specific filename verification
2015-03-10 11:02:47 +01:00
Thomas Müller 214fa44400 Merge pull request #14534 from owncloud/add-child-src
Add support for 'child-src' directive
2015-03-10 10:30:44 +01:00
Thomas Müller 89be55a672 let insertIfNotExist() throw the native DBALException - no need to hide the real exception 2015-03-09 22:37:49 +01:00
Joas Schilling 8fa692388b Allow specifying the compare-array for insertIfNotExists() 2015-03-09 22:37:49 +01:00
Thomas Müller 3623f14e73 no translation service in common storage class 2015-03-09 10:38:38 +01:00
Thomas Müller e28d314b53 deprecate isValidFileName() 2015-03-09 10:38:38 +01:00
Thomas Müller 4bac595068 adding storage specific filename verification - refs #13640 2015-03-09 10:38:37 +01:00
Lukas Reschke cdced56f2b Fix PHPDoc
That apparently went lost when changing the signature.
2015-03-04 15:35:41 +01:00
Joas Schilling b669bf26d6 Fix the behaviour of getLanguageCode() to match the expectation of the name 2015-03-03 16:47:31 +01:00
Lukas Reschke b29940d956 Add support for 'child-src' directive
This is required when working with stuff such as PDF.js in the files_pdfviewer application. Opt-in only.

Master change only because the stable CSP policies has a failback that allows nearly anything 🙈
2015-02-28 12:27:46 +01:00
Bernhard Posselt 970b14d297 Merge pull request #13616 from owncloud/streamresponse
AppFramework StreamResponse
2015-02-27 15:43:01 +01:00
Bernhard Posselt 95239ad21e AppFramework StreamResponse
First stab at the StreamResponse, see #12988

The idea is to use an interface ICallbackResponse (I'm not 100% happy with the name yet, suggestions?) that allow the response to output things in its own way, for instance stream the file using readfile

Unittests are atm lacking, plan is to

check if a mock of ICallbackResponse will be used by calling its callback (also unhappy with this name) method
Usage is:

$response = new StreamResponse('path/to/file');

rename io to output, add additional methods and handle error and not modified cases when using StreamResponse

fix indention and uppercasing, also handle forbidden cases

fix indention

fix indention

no forbidden, figuring out if a file is really readable is too complicated to get to work across OSes and streams

remove useless import

remove useless import

fix intendation
2015-02-27 15:42:33 +01:00
Joas Schilling 3a6a0501c4 Add "throws" lines to calling methods and interface aswell 2015-02-27 12:16:53 +01:00
Thomas Müller f72f9e0159 Merge pull request #14530 from owncloud/revert-14403
Revert "Updating license headers"
2015-02-27 00:39:29 -08:00
Morris Jobke 0c1e6fad6c Merge pull request #14300 from owncloud/commandbus
Add async command system to handle asynchronous operations
2015-02-26 15:10:13 +01:00
Morris Jobke 06aef4e8b1 Revert "Updating license headers"
This reverts commit 6a1a4880f0.
2015-02-26 11:37:37 +01:00
Thomas Müller c62eb9d652 owncloud -> ownCloud 2015-02-25 22:21:24 +01:00
Bernhard Posselt 4e29a4d867 deprecate getters for deprecated class 2015-02-25 22:21:24 +01:00
Bernhard Posselt 7b2fdbfb0b use IDBConnection and close cursors after insert/update/delete 2015-02-25 22:21:24 +01:00
Bernhard Posselt fb84e7d282 migrate to IDBConnection 2015-02-25 22:21:24 +01:00
Robin Appelman bf65b1f18b Rename getAsyncCommandBus to getCommandBus 2015-02-25 15:09:41 +01:00
Robin Appelman 8213f8d67d Allow apps to determine which commands should be run synchronous based on traints 2015-02-25 15:09:41 +01:00
Robin Appelman 74ae7b8929 Add async command system to handle asynchronous operations 2015-02-25 15:08:40 +01:00
Lukas Reschke d43d34c93f Merge pull request #14195 from owncloud/activity-manager-performance-improvements
Activity manager performance improvements
2015-02-24 15:19:15 +01:00
Vincent Petry 4290e1990e Merge pull request #13829 from owncloud/appmanager-list
Better caching for enabled apps
2015-02-23 16:03:32 +01:00
Jenkins for ownCloud 6a1a4880f0 Updating license headers 2015-02-23 12:13:59 +01:00
Lukas Reschke fcc5f5a4f4 Merge pull request #13777 from owncloud/close-cursor
Close cursor for appframework and manipulation queries if applicable
2015-02-20 20:15:22 +01:00
Clark Tomlinson 8d09cc3b91 Merge pull request #13989 from owncloud/enhancment/security/11857
Allow AppFramework applications to specify a custom CSP header
2015-02-18 10:27:29 -05:00
Robin Appelman 04628cf368 better name for getAppsEnabledForUser 2015-02-17 15:05:29 +01:00
Lukas Reschke 9f91d64918 Make scrutinizer happy 2015-02-16 22:13:00 +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
Joas Schilling f808acd317 Add visibility to interface to make scrutinizer 1 step happier 2015-02-16 17:46:43 +01:00
Robin Appelman 2b58e8489f Add getInstalledApps and getAppsForUser to the app manager 2015-02-16 15:15:35 +01:00
Lukas Reschke a9d1a01440 Rename to allowEval 2015-02-16 12:30:21 +01:00
Lukas Reschke b20174bdad Allow AppFramework applications to specify a custom CSP header
This change allows AppFramework applications to specify a custom CSP header for example when the default policy is too strict. Furthermore this allows us to partially migrate away from CSS and allowed eval() in our JavaScript components.

Legacy ownCloud components will still use the previous policy. Application developers can use this as following in their controllers:
```php
$response = new TemplateResponse('activity', 'list', []);
$cspHelper = new ContentSecurityPolicyHelper();
$cspHelper->addAllowedScriptDomain('www.owncloud.org');
$response->addHeader('Content-Security-Policy', $cspHelper->getPolicy());
return $response;
```

Fixes https://github.com/owncloud/core/issues/11857 which is a pre-requisite for https://github.com/owncloud/core/issues/13458 and https://github.com/owncloud/core/issues/11925
2015-02-16 11:00:41 +01:00
Lukas Reschke 025110821f URLEncode logout attribute
Otherwise logout can fail if the requesttoken contains a +
2015-02-13 12:08:23 +01:00
Joas Schilling 6c349c00bb Order methods to by grouped by their task 2015-02-13 11:55:06 +01:00
Lukas Reschke 86139fcce8 Deprecate `OC_JSON` and `OCP\JSON`
This deprecates – but not removes – those two classes and all functions in it. There is no reason that new developments should use those methods as with the AppFramework there is a replacement that allows testable code.

With the `@deprecated` annotation IDEs like PHPStorm will point out to the developer that a functionality is deprecated and that there is a better suited replacement.
2015-02-12 00:56:13 +01:00
Morris Jobke 1bb6de7c1b Merge pull request #13425 from owncloud/phpdoc_cleanup
Cleanup of PHPDoc return types
2015-02-10 01:14:00 +01:00
Vincent Petry 5296767393 Merge pull request #13921 from owncloud/ocs-af
Add a controller and reponse for ocs
2015-02-09 18:11:47 +01:00
Lukas Reschke 47c7eb4e70 Merge pull request #13973 from owncloud/enhancement/security/13366
Respect `mod_unique_id` and refactor `OC_Request::getRequestId`
2015-02-09 17:35:19 +01:00
Lukas Reschke 770fa761b8 Respect `mod_unique_id` and refactor `OC_Request::getRequestId`
When `mod_unique_id` is enabled the ID generated by it will be used for logging. This allows for correlation of the Apache logs and the ownCloud logs.

Testplan:

- [ ] When `mod_unique_id` is enabled the request ID equals the one generated by `mod_unique_id`.
- [ ] When `mod_unique_id` is not available the request ID is a 20 character long random string
- [ ] The generated Id is stable over the lifespan of one request

Changeset looks a little bit larger since I had to adjust every unit test using the HTTP\Request class for proper DI.

Fixes https://github.com/owncloud/core/issues/13366
2015-02-09 11:53:11 +01:00
Bernhard Posselt b89ddcfe41 fix license email 2015-02-05 14:09:01 +01:00