Commit Graph

2652 Commits

Author SHA1 Message Date
Thomas Müller 32067ac49b Merge pull request #21989 from owncloud/make-csp-modifiable
Add public API to give developers the possibility to adjust the global CSP defaults
2016-02-01 10:10:40 +01:00
Thomas Müller a025b2865f Merge pull request #22022 from owncloud/share_ocs_filter_path_sharedwithme
Add path filter to OCS Share API shared_with_me=true
2016-02-01 09:00:31 +01:00
Roeland Jago Douma d3e79f3bb6 Add Unit tests 2016-01-30 15:40:35 +01:00
Thomas Müller 67bf225fbe Merge pull request #21956 from owncloud/cross-cache-move
Add fallback moveFromCache implementation
2016-01-29 17:03:16 +01:00
Roeland Jago Douma a24e7f6558 Add path filter to OCS Share API ?shared_with_me=true
This allows all clients to quickly get the share info for a given path.
Instead of returning everything and filtering it then manually on the
client side.
2016-01-29 15:36:23 +01:00
Arthur Schiwon 01cdc70f9c introduce comments read marke tables, comes with user cleanup after deletion 2016-01-29 13:08:02 +01:00
Arthur Schiwon d2882b9021 Comments WebDAV adjustements 2016-01-29 13:08:02 +01:00
Robin Appelman ec3f6549f6 Add fallback moveFromCache implementation 2016-01-29 13:06:59 +01:00
Roeland Jago Douma 1ff4ec1cd3 [Share 2.0] When deleting a group share delete children
For group shares we can have children. Those are custom shares when a
user has moved or deleted a group share. Those also have to be deleted
if the group share is removed.
2016-01-28 20:35:46 +01:00
Lukas Reschke 809ff5ac95 Add public API to give developers the possibility to adjust the global CSP defaults
Allows to inject something into the default content policy. This is for
example useful when you're injecting Javascript code into a view belonging
to another controller and cannot modify its Content-Security-Policy itself.
Note that the adjustment is only applied to applications that use AppFramework
controllers.

To use this from your `app.php` use `\OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy)`,
$policy has to be of type `\OCP\AppFramework\Http\ContentSecurityPolicy`.

To test this add something like the following into an `app.php` of any enabled app:
```
$manager = \OC::$server->getContentSecurityPolicyManager();
$policy = new \OCP\AppFramework\Http\ContentSecurityPolicy(false);
$policy->addAllowedFrameDomain('asdf');
$policy->addAllowedScriptDomain('yolo.com');

$policy->allowInlineScript(false);
$manager->addDefaultPolicy($policy);
$policy = new \OCP\AppFramework\Http\ContentSecurityPolicy(false);
$policy->addAllowedFontDomain('yolo.com');
$manager->addDefaultPolicy($policy);

$policy = new \OCP\AppFramework\Http\ContentSecurityPolicy(false);
$policy->addAllowedFrameDomain('banana.com');
$manager->addDefaultPolicy($policy);
```

If you now open the files app the policy should be:

```
Content-Security-Policy:default-src 'none';script-src yolo.com 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src yolo.com 'self';connect-src 'self';media-src 'self';frame-src asdf banana.com 'self'
```
2016-01-28 18:36:46 +01:00
Thomas Müller b7710ab6d7 Merge pull request #21858 from owncloud/getMountsForFileId
add IUserMountCache->getMountsForFileId
2016-01-28 11:20:42 +01:00
Roeland Jago Douma 34e912ab6b [Share 2.0] Fix interfaces and comments
* Made comments more clear
* Removed unneeded methods
* IShares shareTime is now a proper DateTime object
* IShares getPath -> getNode & setPath -> setNode
* Fix unit tests
2016-01-28 07:54:09 +01:00
Roeland Jago Douma f2e70441e4 [Share 2.0] Add getShareManager to OCP\IServerContainer 2016-01-27 22:04:37 +01:00
Roeland Jago Douma 185b9c6edd [Share 2.0] Move IShare to OCP 2016-01-27 22:04:37 +01:00
Roeland Jago Douma 0832cca54e [Share 2.0] Fix IShare 2016-01-27 22:04:09 +01:00
Lukas Reschke cb1a64b949 Check whether ownCloud is installed
ownCloud might not yet be setup. This causes an issue as the user config requires a setup ownCloud. Thus this needs a block whether ownCloud is installed or not.

Fixes https://github.com/owncloud/core/issues/21955
2016-01-27 18:30:18 +01:00
Thomas Müller 6973718fb8 Merge pull request #21940 from owncloud/share2_do_not_returned_removed_group_shares
[Share 2.0] Properly handle user deleted group shares
2016-01-27 16:16:06 +01:00
Joas Schilling 2563c3ffaf Fix failing oracle and postgres tests 2016-01-27 12:53:44 +01:00
Robin Appelman 644a8ab797 add IUserMountCache->getMountsForFileId 2016-01-27 12:53:44 +01:00
Thomas Müller 1594371c8c Merge pull request #21741 from owncloud/l10n-improvements
Move methods to the factory that are not related to translating, but to guessing/finding the language
2016-01-27 09:37:00 +01:00
Thomas Müller 5b7a1b13f3 Merge pull request #21887 from owncloud/share2_updateShare
[Sharing 2.0] update share
2016-01-27 09:36:41 +01:00
Thomas Müller c274f03e12 Merge pull request #21906 from owncloud/querybuilder-clob-comparison
Querybuilder clob comparison
2016-01-27 09:36:21 +01:00
Roeland Jago Douma a4900d721f [Share 2.0] Properly handle user deleted group shares
If a user deletes a group share we create a special share entry. To the
API this is just a normal group share for that user with permissions 0.
But we should not return this.
2016-01-27 09:02:12 +01:00
Roeland Jago Douma d11682dcb4 Fix comments from Thomas 2016-01-26 15:31:52 +01:00
Joas Schilling 7514695399 Fix Oracle comparisons 2016-01-26 14:56:07 +01:00
Joas Schilling bd444ae3c3 Add tests for clob comparisons 2016-01-26 14:56:07 +01:00
Roeland Jago Douma c090d709e7 We must resolve to the proper usergroup share 2016-01-26 14:14:54 +01:00
Joas Schilling f413b3ff3a Add tests for findAvailableLanguages 2016-01-26 14:02:32 +01:00
Joas Schilling 70396581eb Add tests for findLanguage() 2016-01-26 14:02:32 +01:00
Joas Schilling fe411788b7 Remove tests for wrapper 2016-01-26 14:02:31 +01:00
Joas Schilling b24b198a83 Add tests for the factory 2016-01-26 14:02:31 +01:00
Joas Schilling 8f9cc51559 Add tests for the new l10n class 2016-01-26 14:02:31 +01:00
Joas Schilling 1199619518 Move legacy test file to new location 2016-01-26 14:02:31 +01:00
Joas Schilling 2cb26a9151 Fix the tests 2016-01-26 14:02:31 +01:00
Joas Schilling 043625ee52 Move findLanguage() and setLanguageFromRequest() to factory 2016-01-26 14:02:31 +01:00
Roeland Jago Douma 44c073b1e6 [share 2.0] manager unit tests 2016-01-26 13:59:58 +01:00
Roeland Jago Douma 59c2aae54f [Share 2.0] Fix unit tests 2016-01-26 13:59:58 +01:00
Roeland Jago Douma 7239fea0f0 [Share 2.0] Add unit test for the default share provider 2016-01-26 13:59:58 +01:00
Thomas Müller 5285460669 Merge pull request #21845 from owncloud/sync-system-addressbook-on-avatar-change
Changing the avatar of the user emits the changeUser event which trig…
2016-01-26 11:37:17 +01:00
Thomas Müller 2bafb1c649 Merge pull request #21894 from owncloud/refactor-csrf
Add new CSRF manager for unit testing purposes
2016-01-26 11:36:56 +01:00
Thomas Müller a1ca9de0f5 Trigger change on avatar delete 2016-01-25 20:56:04 +01:00
Thomas Müller 68ef6e1bdd Assert that User::triggerChange is called upon avatar change 2016-01-25 20:05:11 +01:00
Thomas Müller f165ad8864 Changing the avatar of the user emits the changeUser event which triggers update of the system addressbook 2016-01-25 20:05:11 +01:00
Lukas Reschke a977465af5 Add new CSRF manager for unit testing purposes
This adds a new CSRF manager for unit testing purposes, it's interface is based upon https://github.com/symfony/security-csrf. Due to some of our required custom changes it is however not possible to use the Symfony component directly.
2016-01-25 20:03:40 +01:00
Thomas Müller 728caf13f8 Adding support of -1 as size to be passed into get and getFile 2016-01-25 16:54:40 +01:00
Thomas Müller 99e9c81c8b Merge pull request #21841 from owncloud/share2_deletefromself
[Share 2.0] Add deleteFromSelf method
2016-01-22 17:27:17 +01:00
Thomas Müller 7731b29136 Merge pull request #21719 from owncloud/move-notification-api-to-ocp
Move the notification API to public namespace
2016-01-22 16:20:26 +01:00
Roeland Jago Douma a6600e95dc [Share 2.0] Add deleteFromSelf method
This allows recipient to delete a share. For user shares this is the
same as deleting (at least for now).
But for group shares this means creating a new share with type 2. With
permissions set to 0.
2016-01-22 15:06:50 +01:00
Thomas Müller 9b4c9a0357 Merge pull request #18531 from owncloud/ext-user-credentials
External storage 'Login credentials' auth mechanism
2016-01-22 13:14:14 +01:00
Thomas Müller 0bccdbc959 Merge pull request #21849 from owncloud/add-custom-marker-into-htaccess
Add custom marker into htaccess and execute integrity check after installation
2016-01-22 13:13:59 +01:00
Thomas Müller e3013a99ef Merge pull request #21816 from owncloud/require-a-specific-path-instead-of-autoguessing
Use path instead of app id for occ app signing
2016-01-22 13:13:41 +01:00
Lukas Reschke bc62aa1ef5 Exclude .htaccess modifications from code checker
After the initial installation ownCloud will write some content into the .htaccess file such as the 404 or 403 directives. This adds a magic marker into the .htaccess file and only the content above this marker will be compared in the integrity checker.
2016-01-22 11:51:54 +01:00
Thomas Müller 1410120758 Merge pull request #20768 from owncloud/mount-cache
cache mountpoints in the db
2016-01-22 11:01:54 +01:00
Joas Schilling ee02165005 Move the notification API to public namespace 2016-01-22 10:32:42 +01:00
Thomas Müller e2e5eedb40 Merge pull request #21824 from owncloud/list-of-notifiers
Make it possible to get a list of notifiers for a potential settings …
2016-01-22 10:24:46 +01:00
Joas Schilling 3cca8498cb Make it possible to get a list of notifiers for a potential settings page 2016-01-22 08:47:21 +01:00
Roeland Jago Douma 9b5ea18ce5 Add Unit tests for the default share provider 2016-01-21 16:06:12 +01:00
Thomas Müller e2f231d051 Merge pull request #21761 from owncloud/share2_link
Share2 link
2016-01-21 15:43:08 +01:00
Thomas Müller 7c7467fe42 Merge pull request #21792 from owncloud/systemtags-managerfactory
Allow custom implementation of system tag managers
2016-01-21 12:13:01 +01:00
Roeland Jago Douma 88bc8634d2 Add Unit tests 2016-01-20 21:56:55 +01:00
Lukas Reschke ea367b598a Use path instead of app id
This change requires the usage of a path instead of the App ID when signing code. This has the advantage that developers can also sign code under a different location to make it easier. (e.g. remove `.git`, …)

Also it adds an example command usage as well as a link to the documentation
2016-01-20 20:38:18 +01:00
Vincent Petry 899f9bd113 Allow custom implementation of system tag managers
Added config.php option to replace the default implementation of system
tag manager and system tag object mapper.

Also adjusted the comments manager factory to inject the server container
2016-01-20 16:36:10 +01:00
Robin Appelman 99415a9f7f multiple minor fies 2016-01-20 16:32:52 +01:00
Robin Appelman 222e719c87 sort in tests 2016-01-20 16:30:22 +01:00
Robin Appelman 8940429976 log duplicates 2016-01-20 16:30:22 +01:00
Robin Appelman cf6ee1c866 cache mountpoints in the db 2016-01-20 16:30:22 +01:00
Thomas Müller aeb89947a2 Introduce IUser::setEMailAddress and add hook mechanism 2016-01-20 14:57:20 +01:00
Roeland Jago Douma 7a946a05f5 Properly DI the servercontainer 2016-01-20 08:33:36 +01:00
Morris Jobke 930555bd5e properly use standard
* JEDEC standard - https://en.wikipedia.org/wiki/JEDEC_memory_standards#Unit_prefixes_for_semiconductor_storage_capacity
2016-01-19 10:41:12 +01:00
Thomas Müller 14c98b4df7 Merge pull request #21519 from owncloud/propagate-folder-size
propagate folder size in the same query for write updates
2016-01-18 16:57:30 +01:00
Robin Appelman 7ba715d144 fix test 2016-01-18 12:08:58 +01:00
Robin McCorkell da4127d23b Introduce CredentialsManager for storage of credentials in DB
CredentialsManager performs a simple role, of storing and retrieving
encrypted credentials from the database. Credentials are stored by user
ID (which may be null) and credentials identifier. Credentials
themselves may be of any type that can be JSON encoded.

The rationale behind this is to avoid further (mis)use of
oc_preferences, which was being used for all manner of data not related
to user preferences.
2016-01-18 11:10:41 +01:00
Robin McCorkell 88cd615214 Introduce IDBConnection::setValues()
setValues() attempts to insert a new row, or failing that, update an
existing row. The ability to set preconditions is also available.
2016-01-18 11:10:41 +01:00
Thomas Müller 807cf750b3 Merge pull request #21705 from owncloud/improve-background-job-message
Improve background job error message
2016-01-15 20:12:26 +01:00
Robin Appelman ddbbe1742f propagate folder size in the same query for write updates 2016-01-15 15:36:52 +01:00
Thomas Müller f6c4b10189 Add message key to context of logException 2016-01-15 14:55:30 +01:00
Thomas Müller b37634a57d Merge pull request #21721 from owncloud/capped-memcache-indirect-set
Allow indirect set in CappedMemoryCache
2016-01-15 12:37:36 +01:00
Thomas Müller d8867f7692 Merge pull request #21723 from owncloud/prevent-group-enable-for-apps
Prevent group enable for apps
2016-01-15 12:26:43 +01:00
Thomas Müller 52040a3f23 Merge pull request #20898 from owncloud/cache-interfaces
Public Cache interfaces
2016-01-15 12:02:31 +01:00
Joas Schilling e3a0858444 Check whether the app can be enabled for groups 2016-01-14 15:45:48 +01:00
Robin Appelman d195584a32 Allow indirect set in CappedMemoryCache 2016-01-14 15:00:41 +01:00
Robin Appelman d2c579e167 fix quota wrapper 2016-01-14 12:54:42 +01:00
Robin Appelman 62d383e1ba fix tests 2016-01-14 12:54:42 +01:00
Roeland Jago Douma 0f454ff5aa Use namedparameter 2016-01-14 10:54:40 +01:00
Morris Jobke 86f08f59d6 use logException() to properly log the exception 2016-01-14 10:40:23 +01:00
Morris Jobke 64c8427d81 Improved error message for failing background job 2016-01-14 09:49:40 +01:00
Roeland Jago Douma 4cc2230c58 [Share 2.0] Fix pre_share and post_share hooks 2016-01-13 21:56:04 +01:00
Roeland Jago Douma 5f5951c8cf [Share 2.0] Let the factory do the factory stuff
* Updated unit tests (bit cleaner now)
2016-01-13 16:35:15 +01:00
Roeland Jago Douma cbd3050f4c [Share 2.0] Use full share id (providerId:shareId)
Now that we support multiple managers we communicate shares to the
outside as 'providerId:shareId'. This makes sures that id's are unique
when references from the OCS API.

However, since we do not want to break the OCS API v1 we need to
somewhat hack around this.

When we switch to OCS API v2 (which we should when we support more
custom providers). We will change the id to always be the fullShareId.
2016-01-13 16:35:15 +01:00
Roeland Jago Douma 67b7ebccd1 [Share 2.0] Add share provider factory
* Add providers
* Add share manager to server container
* Use share manager from server container
* Properly get the share manager
2016-01-13 16:35:14 +01:00
Roeland Jago Douma b4de427c1e [Share 2.0] Allow registering of share providers
* Properly register the default share provider
2016-01-13 16:35:07 +01:00
Thomas Müller 3ee3d02a76 Merge pull request #20018 from owncloud/cache_group_backend
The group database backend should cache groups
2016-01-13 15:58:21 +01:00
Lukas Reschke 0c65f4b2c6 Fix unit test
No idea why they passed locally before as well on the branch on the PR. Scary...
2016-01-13 11:22:44 +01:00
Thomas Müller 37e8a87d46 Merge pull request #21591 from owncloud/add-code-checking-for-apps
Verify signature of apps with level "Official" coming from the appstore
2016-01-13 10:35:00 +01:00
Thomas Müller 5565b19382 Merge pull request #21648 from owncloud/smb-statcache-cap
cap the number of entries we cache in smb's statcache
2016-01-13 10:33:43 +01:00
Lukas Reschke 08e73d2c8f Add hidden config switch to disable code integrity checking
This adds a hidden config flag that allows somebody to disable the code integrity check. If `integrity.check.disabled` is set to `true` in the config file:

1. The integrity check functions will return always an empty result
2. The integrity check is not performed when installing apps
3. The integrity check is not performed when updating apps
4. The integrity check is not performed when updating the core

Furthermore this adds support for a list of channels that the code checker will run on. At the moment this is only stable because I didn't want to break any build scripts that we have. Once we have a proper CA setup and updated the build process to sign the releases we can add the RC, alpha, beta as well as daily releases. So everything except "git" basically.
2016-01-12 18:48:36 +01:00
Robin Appelman d8d6368dd7 cap the number of entries we cache in smb's statcache 2016-01-12 13:26:58 +01:00
Robin Appelman c15cab7ed6 Allow admins to add system wide root certificates 2016-01-12 12:50:59 +01:00
Thomas Müller 3ec8789c77 Merge pull request #21628 from owncloud/deprecated_secure_random_funcions
Replace deprecated function calls to SecureRandom
2016-01-12 09:12:13 +01:00
Roeland Jago Douma 3c8f4784e9 Inject DBConnection
* Use query builder
* Minor unit tests additions
2016-01-12 08:24:08 +01:00
Roeland Jago Douma 07fd3889b1 Fix unit tests 2016-01-11 20:29:48 +01:00
Roeland Jago Douma 876fb83ddc getMediumStrengthGenerator is deprecated and does not do anything anymore 2016-01-11 20:06:30 +01:00
Roeland Jago Douma 98c4951f45 getLowStrengthGenerator does not do anything anymore 2016-01-11 19:59:15 +01:00
Roeland Jago Douma eccd9ca1cb Remove unused deprecated function 2016-01-11 16:41:46 +01:00
Roeland Jago Douma e01a488b31 Remove generateRandomBytes from OC_Util 2016-01-10 22:07:33 +01:00
Lukas Reschke c009d5dcc1 Verify signature of apps with level "Official" coming from the appstore
This change will verify the signature of all apps with the level "Official" coming from the appstore or if they have been signed before.
2016-01-10 19:40:28 +01:00
Thomas Müller a1a8a06042 Merge pull request #21527 from owncloud/remove_all_avatars
Remove all cache avatars on avatar deletion
2016-01-08 09:41:25 +01:00
Roeland Jago Douma 4e6f6518ff Remove all cache avatars on avatar deletion
Fixes #21513

Since we cache the generated avatars. We should also delete the
generated sizes when we remove the avatar.
2016-01-07 20:51:18 +01:00
Thomas Müller 1cc6fddead Merge pull request #21498 from owncloud/cleanup-OC_DB
Cleanup OC_DB methods
2016-01-07 20:13:16 +01:00
Thomas Müller f6f492ba4e Merge pull request #21502 from owncloud/di_mimetypedetector
Add 'OCP\Files\IMimeTypeDetector' to DI container
2016-01-07 16:18:55 +01:00
Thomas Müller 9ca670f94f Merge pull request #21505 from owncloud/allow-downgrades-for-brave-developers
Allow downgrades for our brave developers, that switch between branches
2016-01-07 16:03:36 +01:00
Thomas Müller 601457d221 Merge pull request #20773 from owncloud/share2.0_create
[Sharing 2.0] create share
2016-01-07 14:57:05 +01:00
Morris Jobke 190cc2bb67 Remove OC_DB::getConnection 2016-01-07 14:54:55 +01:00
Morris Jobke fddece9552 Remove OC_DB::insertid 2016-01-07 14:54:55 +01:00
Morris Jobke 547fbfdb76 Remove OC_DB::dropTable 2016-01-07 14:54:54 +01:00
Joas Schilling fd7ed93937 Allow downgrades for our brave developers, that switch between branches 2016-01-07 14:18:33 +01:00
Roeland Jago Douma cd35ad6aaa Add 'OCP\Files\IMimeTypeDetector' to DI container
* Added test to server container as well
2016-01-07 13:20:43 +01:00
Morris Jobke 604897945b Move lib/repair to lib/private/repair 2016-01-07 09:14:35 +01:00
Roeland Jago Douma 1358e5dcd9 [Sharing 2.0] Some error cases report 404 instead of 403 2016-01-06 15:25:29 +01:00
Roeland Jago Douma 26280e1f19 [Sharing 2.0] Add L10N instance to manager for translated errors 2016-01-06 14:53:43 +01:00
Roeland Jago Douma b15be8f96f [Share 2.0] Make the share manager ready for share creation 2016-01-06 14:53:43 +01:00
Roeland Jago Douma a08c497808 [Share 2.0] Make share provider ready for create shares 2016-01-06 14:53:43 +01:00
Lukas Reschke 836e96a95e Assign DB group for unit tests 2016-01-04 15:09:01 +01:00
Lukas Reschke fec41e7539 Move regeneration of session ID into session classes
There were code paths that nowadays call ISession::login directly thus bypassing the desired regeneration of the session ID. This moves the session regeneration deeper into the session handling and thus ensures that it is always called. Furthermore, I also added the session regeneration to the remember me cookie plus added some test case expectations for this.
2016-01-04 15:09:01 +01:00
Thomas Müller 24271cf953 Merge pull request #21216 from owncloud/fopen-statcache
Clear SMB statcache after fopen
2015-12-28 10:21:26 +01:00
Roeland Jago Douma b2df7b6b8a Fix unit test 2015-12-24 09:20:26 +01:00
Bernhard Posselt 23c754aed3 prefer scalar type hints over phpdoc annotation
use method exists lookup to be safe and not break on old hhvm versions

add test that checks if type hint is preferred over annotation
2015-12-24 09:20:26 +01:00
Vincent Petry d7169ffdec Restore DB connection after failure
In case of failure, PHPUnit seems to skip `tearDown`, so any useful
assertion messages cannot be shown because `tearDownAfterClass` is
throwing an error because of database usage.

This commit makes sure we also restore the database in
`tearDownAfterClass` to prevent the data root restoration to fail
2015-12-21 18:14:29 +01:00
Thomas Müller 0b913f00c7 Merge pull request #21289 from owncloud/issue-20399-keep-periodic-background-jobs
Do not delete background jobs, in case an exception occured
2015-12-21 09:47:07 +01:00
Thomas Müller 6cdaf754b2 Merge pull request #21290 from owncloud/public-api-usage-getversion
Use OCP\Util::getVersion instead of the internal private implementation
2015-12-18 16:07:01 +01:00
Morris Jobke ed98cdf532 Use OCP\Util::getVersion instead of the internal private implementation 2015-12-18 15:26:54 +01:00
Thomas Müller 36cc0528e3 Merge pull request #21288 from owncloud/deprecated_helper_mimetypes
Remove deprecated OC_Helper mimetype functions
2015-12-18 15:23:05 +01:00
Joas Schilling 54558bb5b2 Fix the test to expect the new behaviour 2015-12-18 15:05:32 +01:00
Thomas Müller a743047e82 Merge pull request #21283 from owncloud/cleanup_config
Cleanup OC_Config mess
2015-12-18 14:54:38 +01:00
Thomas Müller 50e8773307 Merge pull request #21280 from owncloud/drop-unused-methods
OC_Helper::makeURLAbsolute is not used anymore
2015-12-18 14:49:55 +01:00
Thomas Müller 22d1b1285e Merge pull request #21277 from owncloud/querybuild-joblist
Use the query builder for the joblist queries
2015-12-18 13:44:02 +01:00
Roeland Jago Douma a54be132fc Removed deprecated unsused function OC_Helper::getStringMimeType 2015-12-18 13:43:44 +01:00
Roeland Jago Douma 4f20e3bac0 Removed deprecated OC_Helper::getSecureMimeType 2015-12-18 13:42:59 +01:00
Morris Jobke 450e2f3bd3 Move OC_Helper code to OCP\Util for linkToRemote 2015-12-18 12:00:18 +01:00
Roeland Jago Douma 0a09004d39 Inject Config into SystemConfig 2015-12-18 11:53:41 +01:00
Morris Jobke e42f262d85 properly use OCP\Util instead of OC_Helper 2015-12-18 11:46:21 +01:00
Morris Jobke 3d55569a27 OC_Helper::makeURLAbsolute is not used anymore 2015-12-18 11:37:18 +01:00
Morris Jobke a18c0983d5 Use TempManager instead of tmpFile 2015-12-18 11:25:33 +01:00
Morris Jobke 90b0831cec Use TempManager instead of tmpFolder 2015-12-18 11:19:53 +01:00
Thomas Müller 9e97bef935 Merge pull request #21268 from owncloud/cleanup-OC_Helper-getFileNameMimeType
Use proper public API for OC_Helper::getFileNameMimeType
2015-12-18 10:15:33 +01:00
Thomas Müller 551e553bf4 Merge pull request #21264 from owncloud/deprecated_oc_user_methods
Cleanup OC_User deprecated methods
2015-12-18 10:15:18 +01:00
Joas Schilling 345e68cafa Use the query builder for the joblist queries 2015-12-18 09:50:23 +01:00
Thomas Müller 2709244acd Only perform tearDown operations on the database if we have a connection to it ..... 2015-12-17 17:29:50 +01:00
Thomas Müller 8f6a257f1b Use proper base class 2015-12-17 17:29:17 +01:00
Thomas Müller 26f416b9f5 Assert that there are no xml error left 2015-12-17 17:18:42 +01:00
Morris Jobke ecdf88e41b Use proper public API for OC_Helper::getFileNameMimeType 2015-12-17 17:07:48 +01:00
Roeland Jago Douma 1f715289bf Removed deprecated function OC_User::deleteUser
Replaced with proper OCP calls
2015-12-17 16:18:40 +01:00
Roeland Jago Douma 835911bce5 Removed deprecated private OC_User::createUser
All function calls are replaced with the recommended (which was already
the body of the function).
2015-12-17 16:18:40 +01:00
Roeland Jago Douma 7e44ea5da0 Remove deprecated function OC_User::getManager
Private deprecated function => removed
Replaced all instances with suggested replacement
2015-12-17 16:18:34 +01:00
Thomas Müller e3ed42135d Merge pull request #21240 from owncloud/avatar_speedup
Avatar speedup
2015-12-17 14:43:21 +01:00
Roeland Jago Douma 205c239eab Remove deprecated OC_Helper::linkTo function 2015-12-17 11:51:40 +01:00
Roeland Jago Douma d796c43841 [Avatars] Add function to get the Node of the avatar
Since we usually just get the avatar and stream the content to the users
there is no need to first create an image in memory.
2015-12-16 20:29:02 +01:00
Robin Appelman 38a2467a4f test for statcache after fopen 2015-12-15 13:48:17 +01:00
Björn Schießle efc030aa25 don't allow to create a federated share if source and target server are the same 2015-12-14 17:16:14 +01:00
Thomas Müller f831d93f3f Merge pull request #20878 from owncloud/proper-htaccess-support-in-code-signing-checker
Also run .htaccess routine when installing on another system than Apache
2015-12-11 11:46:37 +01:00
Thomas Müller 6317ba8cb4 Merge pull request #21135 from owncloud/add-polyfill
Add polyfills for PHP55, PHP56 and PHP70 functionalities
2015-12-11 11:40:51 +01:00
Lukas Reschke f3360d51c6 Use PHP polyfills 2015-12-11 08:47:36 +01:00
Scrutinizer Auto-Fixer ffc49a24f0 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-12-10 16:43:37 +01:00
Thomas Müller df15d54db6 Merge pull request #21072 from owncloud/db-lock-ttl
Remove all locks after ttl from the db
2015-12-10 13:51:18 +01:00
Lukas Reschke 29b6a03fc1 Add assertion to test
This seems to be missing on that test.
2015-12-10 09:29:24 +01:00
Arthur Schiwon 81d763be42 use expectedException annotation, not via method call, for consistency 2015-12-09 16:55:07 +01:00
Arthur Schiwon fdd06ba1f8 use getLastInsertId from query builder for convenience 2015-12-09 16:33:34 +01:00
Robin Appelman e191953942 Remove all locks after ttl from the db 2015-12-09 14:53:24 +01:00
Arthur Schiwon 8e298f51f8 adjust test's fakemanager to interface change 2015-12-09 14:38:01 +01:00
Arthur Schiwon 0c1c029571 hardening, add some checks for whitespace-only strings 2015-12-09 14:34:23 +01:00
Arthur Schiwon 8acbb7aef9 rework test about overwriting default comments manager 2015-12-09 14:34:23 +01:00
Arthur Schiwon d3692c3283 namespaces for tests 2015-12-09 14:34:23 +01:00
Arthur Schiwon 9a440c06b0 OC not oc 2015-12-09 14:34:23 +01:00
Arthur Schiwon e3dbc3d40c different strategy in cleaning up after user was deleted
we do not listen to deletion hooks anymore, because there is no guarantee that they
will be heard - requires that something fetches the CommentsManager first.

Instead, in the user deletion routine the clean up method will be called directly. Same way
as it happens for files, group memberships, config values.
2015-12-09 14:34:23 +01:00
Arthur Schiwon 2ce2de0ae5 add icommentsmanger and icomment implementation
register CommentsManager service, allow override, document in config.sample.php

don't insert autoincrement ids in tests, because of dislikes from oracle and pgsql

specify timezone in null date

only accepts strings for ID parameter that can be converted to int

replace forgotten hardcoded IDs in tests

react on deleted users

react on file deletion

Postgresql compatibility

lastInsertId needs *PREFIX* with the table name

do not listen for file deletion, because it is not reliable (trashbin, external storages)

add runtime cache for comments
2015-12-09 14:34:23 +01:00
Thomas Müller 5c95939bf3 Merge pull request #21061 from owncloud/fix-oracle-last-insert-id-test
Fix the last insert id test by changing to an autoincremen…
2015-12-09 11:53:43 +01:00
Thomas Müller bc744ff6de Merge pull request #21038 from owncloud/share-computesharepermissions-notstore
Fix (re)share permission checks in a few code paths
2015-12-09 10:04:56 +01:00
Joas Schilling 5c0be3b565 Fix the last insert id test by changing to an autoincrement table 2015-12-09 09:51:33 +01:00
Vincent Petry 28e9bc1156 Fix more unit tests to pass a mock storage instead of null to FileInfo 2015-12-08 16:33:39 +01:00
Thomas Müller 45fe8271ab Merge pull request #21030 from owncloud/querybuilder-new-features
Querybuilder new features
2015-12-08 13:51:45 +01:00
Thomas Müller 85409b6701 Merge pull request #20786 from owncloud/systemtags-dav
DAV endpoint for system tags
2015-12-08 13:51:25 +01:00
Joas Schilling 9f98849306 Add a method to the get "to use" table and column name 2015-12-08 11:04:28 +01:00
Thomas Müller fe8dc0bd5e Merge pull request #21022 from owncloud/get-rid-of-by-reference
Get rid of by reference
2015-12-08 11:04:25 +01:00
Joas Schilling a3391248e4 Add select distinct to the query builder 2015-12-08 09:49:21 +01:00
Joas Schilling f2c7acb3c0 Allow getting the last insert id without much hassle 2015-12-08 09:40:20 +01:00
Lukas Reschke 6d3eb7673d Add unit test for nested arrays 2015-12-08 09:07:38 +01:00
Lukas Reschke 8289943a0f Do not trust casting 2015-12-08 08:50:00 +01:00
Lukas Reschke 0a89073c47 Run .htaccess updates in any case
This is the same what we also do in updater.php and thus this aligns the code. Makes the code paths more consistent.
2015-12-08 08:16:24 +01:00
Scrutinizer Auto-Fixer 453e1bf66e Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-12-07 15:43:36 +00:00
Thomas Müller a9e5faf7d0 Merge pull request #20981 from owncloud/issue-19848-multiple-emails-for-sharelink
Allow sending a share email to multiple users
2015-12-07 15:17:19 +01:00
Joas Schilling 820c3b852d Add a unit test for single user case as well 2015-12-07 12:01:02 +01:00
Joas Schilling 5b87413792 Allow sending a share email to multiple users 2015-12-07 10:49:34 +01:00
Thomas Müller 0c3d97921f Merge pull request #20904 from owncloud/view-mime-filter
Fix mimetype filter in getDirectoryContent
2015-12-07 10:20:43 +01:00
Vincent Petry 316b907a13 Fixed system tags DAV and API and docs 2015-12-04 17:30:50 +01:00
Thomas Müller 602b636d3e Merge pull request #20807 from owncloud/dont-append-redirect-url-if-user-is-already-logged-in
Don't append redirect URL if user is logged-in
2015-12-03 16:53:59 +01:00
Thomas Müller 0fe5506e91 Merge pull request #20921 from owncloud/last-OC_Config-removals-in-tests
Reduce OC_Config usage in tests/
2015-12-03 15:24:41 +01:00
Morris Jobke cbe6eeffa1 last change of OC_Config to the proper interface in tests/ 2015-12-03 14:03:05 +01:00
Thomas Müller 2d1cc8aaeb Merge pull request #19461 from owncloud/reuse_code
reuse code
2015-12-03 13:55:50 +01:00
Morris Jobke 542ce7dd0d Reduce OC_Config usage in tests/ 2015-12-03 13:48:19 +01:00
Robin Appelman 19b2fe6a3a Fix mimetype filter in getDirectoryContent 2015-12-03 13:09:13 +01:00
Morris Jobke e9c8f82fc5 Replace OC_Config in tests with IConfig calls 2015-12-03 09:38:41 +01:00
Thomas Müller c6bda8d6ca Merge pull request #20902 from owncloud/drop-OC_Config-from-tests
Replace OC_Config in tests with IConfig calls
2015-12-03 09:30:47 +01:00
Thomas Müller e7239b6553 Merge pull request #20872 from owncloud/systemtags-better-not-found-exception
Systemtags better not found exception
2015-12-03 09:26:05 +01:00
Thomas Müller a5c80ba8bc Merge pull request #20894 from owncloud/post-delete-meta-view
Also add metadata for postDelete hooks triggered from the view
2015-12-03 09:24:54 +01:00
Morris Jobke d331e0d4f8 Replace OC_Config in tests with IConfig calls 2015-12-02 23:14:52 +01:00
Thomas Müller dcc7ff09ba Adding unit test for MailNotifications::sendInternalShareMail() 2015-12-02 21:42:14 +01:00
Thomas Müller eebe2b9c23 User IUser::getEMailAddress() all over the place 2015-12-02 21:25:05 +01:00
Thomas Müller df5872ec50 Merge pull request #20719 from owncloud/adding-system-addressbook-of-users
Adding system addressbook for users of this instance - a occ command …
2015-12-02 16:17:58 +01:00
Thomas Müller 28ceab2f61 Fix endless recursion 2015-12-02 14:44:41 +01:00
Robin Appelman 0062888aaf Also add metadata for postDelete hooks triggered from the view 2015-12-02 13:51:26 +01:00
Thomas Müller 8d218bf3ef Merge pull request #20875 from owncloud/remove-changepropagator
remove old propagation logic
2015-12-02 13:03:31 +01:00
Thomas Müller c46ea30248 Merge pull request #20865 from owncloud/post-delete-meta
Add metadata to post delete hooks
2015-12-02 10:12:54 +01:00
Thomas Müller 0391cc0451 Fix getCloudId 2015-12-02 09:14:41 +01:00
Thomas Müller fe67db1ad0 Adding unit test for User::getCloudId() 2015-12-02 09:14:41 +01:00
Thomas Müller df6fc6cc70 Add the user's cloud id to the vCard 2015-12-02 09:14:41 +01:00
Thomas Müller dad6470baa Add IUser::getAvatarImage() for easy access 2015-12-02 09:14:41 +01:00
Roeland Jago Douma b00db2c933 DI in avatar code
* DI in avatar code
* Use the node API
* More unit tests
* Unit tests no longer require DB
2015-12-01 22:15:43 +01:00
Robin Appelman 62cc316c6a remove old propagation logic 2015-12-01 16:50:20 +01:00
Lukas Reschke 2515cb17be Support pretty URLs
This changeset allows ownCloud to run with pretty URLs, they will be used if mod_rewrite and mod_env are available. This means basically that the `index.php` in the URL is not shown to the user anymore.

Also the not deprecated functions to generate URLs have been modified to support this behaviour, old functions such as `filePath` will still behave as before for compatibility reasons.

Examples:
http://localhost/owncloud/index.php/s/AIDyKbxiRZWAAjP => http://localhost/owncloud/s/AIDyKbxiRZWAAjP
http://localhost/owncloud/index.php/apps/files/ => http://localhost/owncloud/apps/files/

Due to the way our CSS and JS is structured the .htaccess uses some hacks for the final result but could be worse... And I was just annoyed by all that users crying for the removal of `index.php` ;-)
2015-12-01 16:46:07 +01:00
Joas Schilling 08d07cc4db Fix the unit test by running tearDown() and cleaning tags before the test 2015-12-01 15:00:44 +01:00
Joas Schilling 1d0c041ac8 Add a method to get the list of tags from the TagNotFound Exception 2015-12-01 14:54:34 +01:00
Robin Appelman 0d63e95a5d Add metadata to post delete hooks 2015-12-01 13:22:58 +01:00
Lukas Reschke 4971015544 Add code integrity check
This PR implements the base foundation of the code signing and integrity check. In this PR implemented is the signing and verification logic, as well as commands to sign single apps or the core repository.

Furthermore, there is a basic implementation to display problems with the code integrity on the update screen.

Code signing basically happens the following way:

- There is a ownCloud Root Certificate authority stored `resources/codesigning/root.crt` (in this PR I also ship the private key which we obviously need to change before a release 😉). This certificate is not intended to be used for signing directly and only is used to sign new certificates.
- Using the `integrity:sign-core` and `integrity:sign-app` commands developers can sign either the core release or a single app. The core release needs to be signed with a certificate that has a CN of `core`,  apps need to be signed with a certificate that either has a CN of `core` (shipped apps!)  or the AppID.
- The command generates a signature.json file of the following format:
```json
{
    "hashes": {
        "/filename.php": "2401fed2eea6f2c1027c482a633e8e25cd46701f811e2d2c10dc213fd95fa60e350bccbbebdccc73a042b1a2799f673fbabadc783284cc288e4f1a1eacb74e3d",
        "/lib/base.php": "55548cc16b457cd74241990cc9d3b72b6335f2e5f45eee95171da024087d114fcbc2effc3d5818a6d5d55f2ae960ab39fd0414d0c542b72a3b9e08eb21206dd9"
    },
    "certificate": "-----BEGIN CERTIFICATE-----MIIBvTCCASagAwIBAgIUPvawyqJwCwYazcv7iz16TWxfeUMwDQYJKoZIhvcNAQEF\nBQAwIzEhMB8GA1UECgwYb3duQ2xvdWQgQ29kZSBTaWduaW5nIENBMB4XDTE1MTAx\nNDEzMTcxMFoXDTE2MTAxNDEzMTcxMFowEzERMA8GA1UEAwwIY29udGFjdHMwgZ8w\nDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANoQesGdCW0L2L+a2xITYipixkScrIpB\nkX5Snu3fs45MscDb61xByjBSlFgR4QI6McoCipPw4SUr28EaExVvgPSvqUjYLGps\nfiv0Cvgquzbx/X3mUcdk9LcFo1uWGtrTfkuXSKX41PnJGTr6RQWGIBd1V52q1qbC\nJKkfzyeMeuQfAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAvF/KIhRMQ3tYTmgHWsiM\nwDMgIDb7iaHF0fS+/Nvo4PzoTO/trev6tMyjLbJ7hgdCpz/1sNzE11Cibf6V6dsz\njCE9invP368Xv0bTRObRqeSNsGogGl5ceAvR0c9BG+NRIKHcly3At3gLkS2791bC\niG+UxI/MNcWV0uJg9S63LF8=\n-----END CERTIFICATE-----",
    "signature": "U29tZVNpZ25lZERhdGFFeGFtcGxl"
}
```
`hashes` is an array of all files in the folder with their corresponding SHA512 hashes (this is actually quite cheap to calculate), the `certificate` is the  certificate used for signing. It has to be issued by the ownCloud Root Authority and it's CN needs to be permitted to perform the required action. The `signature` is then a signature of the `hashes` which can be verified using the `certificate`.

Steps to do in other PRs, this is already a quite huge one:
- Add nag screen in case the code check fails to ensure that administrators are aware of this.
- Add code verification also to OCC upgrade and unify display code more.
- Add enforced code verification to apps shipped from the appstore with a level of "official"
- Add enfocrced code verification to apps shipped from the appstore that were already signed in a previous release
- Add some developer documentation on how devs can request their own certificate
- Check when installing ownCloud
- Add support for CRLs to allow revoking certificates

**Note:** The upgrade checks are only run when the instance has a defined release channel of `stable` (defined in `version.php`). If you want to test this, you need to change the channel thus and then generate the core signature:

```
➜  master git:(add-integrity-checker) ✗ ./occ integrity:sign-core --privateKey=resources/codesigning/core.key --certificate=resources/codesigning/core.crt
Successfully signed "core"
```

Then increase the version and you should see something like the following:

![2015-11-04_12-02-57](https://cloud.githubusercontent.com/assets/878997/10936336/6adb1d14-82ec-11e5-8f06-9a74801c9abf.png)

As you can see a failed code check will not prevent the further update. It will instead just be a notice to the admin. In a next step we will add some nag screen.

For packaging stable releases this requires the following additional steps as a last action before zipping:
1. Run `./occ integrity:sign-core` once
2. Run `./occ integrity:sign-app` _for each_ app. However, this can be simply automated using a simple foreach on the apps folder.
2015-12-01 11:55:20 +01:00
Thomas Müller 08248f66ba Merge pull request #20650 from owncloud/systemtags-core
Implement systemtag managers and mapper
2015-11-30 15:38:43 +01:00
Joas Schilling b8b0ae0944 Fix phpstorm complains in tests 2015-11-30 13:36:22 +01:00
Thomas Müller b94aadc440 Cleanup imports and type hinting 2015-11-30 12:45:30 +01:00
Lukas Reschke f4eb15d340 Show error template
Otherwise this leads to an endless redirection in case of a CSRF exception. Also sets user expectation right.
2015-11-30 11:25:52 +01:00
Thomas Müller dddfa6de78 Don't break app on travis 2015-11-30 10:55:13 +01:00
Thomas Müller 318e5e2864 More group DB 2015-11-30 10:55:13 +01:00
Thomas Müller f9fc254672 Add DB group to some files_external tests
Adding group Db to federation tests and ldap tests

Add group DB to Test_UrlGenerator

Adding group DB to trashbin and versions tests

Adding group DB to Test_Util_CheckServer for pg
2015-11-30 10:55:10 +01:00
Thomas Müller 757aa45db7 Adding more DB groups to test suits
Adding more DB groups to test suits
2015-11-30 10:55:06 +01:00
Thomas Müller 56170dd825 Further unit test suite tweats 2015-11-30 10:55:05 +01:00
Thomas Müller 1480964768 Adding more test suites to group DB 2015-11-30 10:55:05 +01:00
Thomas Müller 7e71d8231e Mock DIContainer to not hit the database 2015-11-30 10:55:05 +01:00
Thomas Müller 3bb6dcea64 Apply DB group annotation ... 2015-11-30 10:55:05 +01:00
Thomas Müller 03ee3b9aec A TestCase which is not annotated to be in group DB will not allow access to the database connection.
This is necessary to categorize unit test and avoid duplicate test case execution - it also allows us to closely review unit test implementations to identify unnecessary db calls.
2015-11-30 10:55:05 +01:00
Joas Schilling 24d5ce9a58 Add phpunit group for tests 2015-11-30 10:25:53 +01:00
Thomas Müller 9c1dbaf0ad Merge pull request #20788 from owncloud/catch-missing-route
Dont die when we're missing a route
2015-11-30 10:11:12 +01:00
Robin Appelman 4c4331982c Merge pull request #20789 from owncloud/scanner-skip-not-available
Skip unavailable storages in scanner
2015-11-27 22:57:47 +01:00
Vincent Petry b666367a79 Added system tags data structure and PHP side managers
Added SystemTagManager and SystemTagObjectMapper
2015-11-27 17:54:29 +01:00
Robin Appelman aa822f76e2 fix tests 2015-11-27 17:05:58 +01:00
Robin Appelman ae71f80f4a Skip unavailable storages in scanner 2015-11-27 14:02:50 +01:00
Mitar e0e51fd79f Added tests. 2015-11-27 02:45:49 -08:00
Thomas Müller 8fe878afe9 Merge pull request #20602 from owncloud/fix-installed-apps
Always installed apps includes the hardcoded ones from shipped.json
2015-11-26 16:50:05 +01:00
Thomas Müller 80c43ffc6c Merge pull request #20702 from owncloud/move-user-principal-into-subfolder
Users are available under it's own principal resource named 'principa…
2015-11-26 16:49:49 +01:00
Thomas Müller 19d5059109 Merge pull request #20393 from owncloud/querybuilder-select-with-alias
Add a method to select a field or value with alias
2015-11-26 16:19:20 +01:00
Thomas Müller 3882cc8ef3 Merge pull request #20744 from owncloud/oc_helper-getMimeType-cleanup
Remove last occurences of OC_Helper::getMimeType()
2015-11-26 12:37:25 +01:00
Thomas Müller 5a33390a69 Merge pull request #20731 from owncloud/per-storage-updater
Make Cache\Updater per storage
2015-11-26 12:01:44 +01:00
Morris Jobke 4fcab98694 Remove unused internal methods
* removes OC_Helper::mb_substr_replace and OC_Helper::mb_str_replace
* keeps public interface wrapper working as expected
2015-11-26 10:25:43 +01:00
Morris Jobke 9318606faf Remove last occurences of OC_Helper::getMimeType()
* ref #4774
2015-11-26 10:18:32 +01:00