Commit graph

2307 commits

Author SHA1 Message Date
Thomas Müller
db1416346c Following the spec:
"`statuscode`: The OCS status code of the response, everything except 100 MUST be handled as failure."
2015-08-05 17:49:44 +02:00
Bernhard Posselt
7cb0934fa2 Merge pull request #18035 from owncloud/ocs-2.0
Adding ocs/v2.php with status code mapper
2015-08-05 17:28:08 +02:00
Thomas Müller
314fc11e1b Merge pull request #18057 from owncloud/import_root_certificates
disable "ssl root certificate" settings if user can't mount external storages
2015-08-05 17:18:46 +02:00
Thomas Müller
6c46430cdb Return 200 not null - we should return consistent types 2015-08-05 11:23:29 +02:00
Lukas Reschke
4efa7c09b1 Use StringUtils::equals on CSRF token and add unit tests 2015-08-04 18:34:33 +02:00
Bjoern Schiessle
dc5e89e624 also block certificate management in the back-end if external storages are disabled for the user 2015-08-04 18:33:19 +02:00
Thomas Müller
acd9b7576d Remove pointless unit test 2015-08-04 12:03:03 +02:00
Thomas Müller
3ecf7fce79 Fix unit test within OCSController 2015-08-03 22:19:04 +02:00
Thomas Müller
649cc2fa89 Remove duplicate and unused code 2015-08-03 21:03:11 +02:00
Thomas Müller
bacf1603ff Adding ocs/v2.php with status code mapper 2015-08-03 16:05:50 +02:00
Robin Appelman
96a9d171b3 Fix db schema 2015-08-03 14:13:36 +02:00
Robin Appelman
4ea7cbb0f5 Add database backend for high level locking 2015-08-03 14:13:35 +02:00
Robin Appelman
a8552a1b24 split off keeping track of acquire locks 2015-08-03 14:12:56 +02:00
Bjoern Schiessle
51a67a54e0 always update file cache, the cache can handle partial data correctly if the file doesn't already exists in the file cache 2015-07-31 17:14:32 +02:00
Roeland Douma
db91b4505c Merge pull request #17805 from owncloud/avatar-handle-errors
[avatar] add error handlers for avatar setup
2015-07-31 07:31:24 +02:00
Robin McCorkell
182bc17aeb Sanitize class names before registerService/query
Leading backslashes are removed, so a `registerService('\\OC\\Foo')`
can still be resolved with `query('OC\\Foo')`.
2015-07-30 21:02:16 +01:00
Morris Jobke
e184157684 [avatar] add error handlers for avatar setup
add colon to translated string

use placeholder in t()

Adding a size limitation for avatar upload

Unit test for file size

Fix typo & display server side error message
2015-07-30 18:05:32 +02:00
Robin McCorkell
0223221a64 Fix incorrect test naming
`tesOverrideService()` was incorrect and wasn't getting called by
PHPUnit. Also, the unit test itself was wrong, but went unnoticed
because of point 1.
2015-07-30 16:06:26 +01:00
Thomas Müller
22fd04eb41 Merge pull request #17981 from owncloud/correct-regex
Correct regular expressions
2015-07-30 16:07:46 +02:00
Lukas Reschke
e95bc68ac7 Check for PDO instead of removed function for PHP 7 compatibility 2015-07-30 12:32:22 +02:00
Lukas Reschke
52cd4efc83 Add more unit tests 2015-07-30 11:25:05 +02:00
Lukas Reschke
ad4c731c4c Correct regular expressions
Previously the regex was only matching on single characters. Meaning that file names such as "👍.txt" where possible while "👍" alone never was. This check apparently never worked as expected.
2015-07-30 11:22:14 +02:00
Morris Jobke
4d672ded24 properly mock dependencies for setup tests 2015-07-30 09:02:35 +02:00
Morris Jobke
8bc4a10dbe fix unit tests 2015-07-29 20:14:28 +02:00
Thomas Müller
5ed38a75d6 Remove remainings of mssql 2015-07-29 18:19:31 +02:00
Robin McCorkell
3ef680d966 Merge pull request #17950 from owncloud/config-dontdetectfschangesinrootbydefault
Disable filesystem_check_changes by default
2015-07-29 15:34:02 +01:00
Vincent Petry
943fc1b8e5 Fix watcher tests to explicitly set policy 2015-07-29 15:10:42 +02:00
Bjoern Schiessle
fb4c99fe06 make sure that we emit the hooks if a file gets moved from a subfolder to the root folder with the nodes API 2015-07-29 11:02:38 +02:00
Roeland Jago Douma
72ba67815e Display warning in security & setup warnings if php version is EOL 2015-07-29 10:07:01 +02:00
Robin McCorkell
6d54d2fad7 Merge pull request #17912 from owncloud/detect-old-openssl-versions
Detect old NSS and OpenSSL versions
2015-07-28 21:26:44 +01:00
Lukas Reschke
7f6c5e456b Add unit tests 2015-07-28 16:32:11 +02:00
Lukas Reschke
0d515de13e Detect old NSS and OpenSSL versions
This will detect old NSS and OpenSSL versions and show appropriate errors in the admin interface.

Fixes https://github.com/owncloud/core/issues/17901
2015-07-28 15:32:19 +02:00
Morris Jobke
c34e63bb1f Merge pull request #15543 from rullzer/mimetypedetector
Mimetypedetector
2015-07-28 13:35:26 +02:00
Roeland Douma
73169b0edb Merge pull request #17195 from rullzer/no_multiple_remote_shares_of_same_file
Remote shares should be uique
2015-07-28 13:06:25 +02:00
Thomas Müller
68f14a943a Merge pull request #17840 from owncloud/fix-enc-wrapper-without-encryption
Only set is encrypted when encryption is enabled
2015-07-27 16:06:39 +02:00
Roeland Jago Douma
d276aebf40 Pass config dir as parameter to detection class
In order to properly test the mimetype function:

* constructor takes path to configdir
* Added unit tests for mimetype (only if vfsStream is available)
2015-07-27 14:59:49 +02:00
Roeland Jago Douma
9cdd637050 Loading of mapping/aliases is done in class 2015-07-27 14:59:49 +02:00
Roeland Jago Douma
141a0f0f47 Move mimetypedetection to files/type/detection 2015-07-27 14:59:45 +02:00
Roeland Jago Douma
6db6689740 Added mimetype detector
* Copied unit tests from old functions
2015-07-27 14:58:45 +02:00
Lukas Reschke
c20d4d1a0b Add unit tests 2015-07-27 11:21:49 +02:00
Bernhard Posselt
d8673dabe3 add test for factories
use ref for factory test

use a factory for registerAlias

Ensure we construct SimpleContainer

Use single instance of DIContainer in routing tests
2015-07-25 01:59:30 +02:00
Thomas Müller
1f8ee61006 Merge pull request #17755 from owncloud/alias-container-alive
Add registerAlias method to shortcut interface registration #17714
2015-07-24 13:11:32 +02:00
Joas Schilling
42baeb36dc Add a unit test for the disabled encryption case 2015-07-23 17:01:44 +02:00
Joas Schilling
02323eca01 Throw a InvalidArgumentException when a consumer/extension is invalid 2015-07-23 11:00:29 +02:00
Morris Jobke
296ed4c276 Merge pull request #17413 from owncloud/public-api-querybuilder
Add public api for Doctrine QueryBuilder and ExpressionBuilder
2015-07-22 17:29:08 +02:00
Roeland Douma
d37b8969f4 Merge pull request #17342 from rullzer/test_preview_conditions
Only run some preview unit tets if imagemagick is available
2015-07-22 09:34:31 +02:00
Joas Schilling
f9071ed5b7 Comment out LIMIT 0 case because of the mixed results 2015-07-21 15:25:48 +02:00
Joas Schilling
c9564503c2 Fix tests for setFirstResult and setMaxResults on oracle 2015-07-21 15:25:48 +02:00
Joas Schilling
22849238fb Set a limit until doctrine released a version that fixes Sqlite
See https://github.com/doctrine/dbal/pull/782 for more info
2015-07-21 15:25:48 +02:00
Joas Schilling
32cb30cb84 Correctly count the number of items (rowCount is Update/Insert/Delete only) 2015-07-21 15:25:47 +02:00
Joas Schilling
577a7c92e1 Can not test the string, thanks oracle.... 2015-07-21 15:25:47 +02:00
Joas Schilling
f77e5f411d Fix existing usages by removing the quotes 2015-07-21 15:25:47 +02:00
Joas Schilling
516f7e8299 Add unit tests and automatic quoting 2015-07-21 15:25:47 +02:00
Joas Schilling
de348180ae Use the public interface and our method instead of the doctrine thing 2015-07-21 15:25:47 +02:00
Morris Jobke
2d691c2fb4 Merge pull request #17381 from owncloud/fix_sharing_add_to_group
[sharing] fix addToGroup hook
2015-07-21 13:30:41 +02:00
Bernhard Posselt
d20e2002a6 Merge pull request #17743 from owncloud/return-proper-statuscodes
Return proper status code in case of a CORS exception
2015-07-20 18:03:25 +02:00
Robin McCorkell
75a5e6e12b Fix mounting wrapped storages resulting in many-layered wrapping
This usually doesn't cause issues, but in unit tests sometimes a wrapped
storage is passed to Filesystem::mount() and gets rewrapped, hitting the
XDebug function nesting level limit when used.
2015-07-20 16:27:26 +01:00
Robin McCorkell
df19cabb44 Store storage availability in database
Storage status is saved in the database. Failed storages are rechecked every
10 minutes, while working storages are rechecked every request.

Using the files_external app will recheck all external storages when the
settings page is viewed, or whenever an external storage is saved.
2015-07-20 16:27:26 +01:00
Robin McCorkell
aac84f732d Unit test OC_Files::setUploadLimit()
There was also a bug with checking the upper limit on the passed upload
size. PHP does funny things with integer vs float comparisons, so our
check didn't work. Now the check is much simpler, and ensures the value
is sane.
2015-07-20 15:03:09 +01:00
Lukas Reschke
7dda86f371 Return proper status code in case of a CORS exception
When returning a 500 statuscode external applications may interpret this as an error instead of handling this more gracefully. This will now make return a 401 thus.

Fixes https://github.com/owncloud/core/issues/17742
2015-07-20 12:54:22 +02:00
Joas Schilling
0dd1a785fe Merge pull request #16935 from owncloud/allow-app-check-code-for-deprecated-classes
Allow app check code for deprecated classes
2015-07-20 08:39:53 +02:00
Bernhard Posselt
a4e3939204 add registerAlias method to shorcut interface registration
remove unused import

add since tag

fix typo
2015-07-18 13:43:54 +02:00
Björn Schießle
f363fc2d4a Merge pull request #17540 from owncloud/enc_detect_legacy_files2
make sure that we always detect legacy files correctly
2015-07-17 21:42:32 +02:00
Thomas Müller
2e1cc2d825 Merge pull request #17682 from owncloud/fix-undefined-REMOTE_ADDR-master
Fixing 'Undefined index: REMOTE_ADDR'
2015-07-17 14:27:33 +02:00
Bjoern Schiessle
a2e2005e67 make sure that we always detect legacy files correctly 2015-07-17 13:30:08 +02:00
Joas Schilling
8a64abf4e4 Only decorate the type when it was matched 2015-07-17 12:34:56 +02:00
Joas Schilling
a0c6f2e5e0 Use the decorator pattern 2015-07-17 12:34:56 +02:00
Joas Schilling
bba87a2a3b Restructor the code into different classes instead of extending 2015-07-17 12:34:56 +02:00
Joas Schilling
eb1c437941 Check for methods as good as possible 2015-07-17 12:34:56 +02:00
Joas Schilling
2783a78070 Allow checking for functions 2015-07-17 12:34:56 +02:00
Joas Schilling
f228a3dc28 Add support for deprecated constants 2015-07-17 12:34:56 +02:00
Joas Schilling
d2fc1b2302 Correctly handle use statements 2015-07-17 12:34:56 +02:00
Joas Schilling
4e95031ec4 Allow app:check-code to check for deprecated methods 2015-07-17 12:34:55 +02:00
Thomas Müller
bd71540c8a Fixing 'Undefined index: REMOTE_ADDR' - fixes #17460 2015-07-16 16:40:57 +02:00
Robin McCorkell
8efa23c895 Fix memcache factory unit tests 2015-07-16 03:53:18 +01:00
Roeland Jago Douma
e35b97e4c5 Added test 2015-07-15 12:49:26 +02:00
Vincent Petry
b3b080e1c0 Strip public webdav info about sharing and mount points
Remove information about whether a file is an incoming share or mount
point when requested over public webdav.
2015-07-13 14:20:35 +02:00
Vincent Petry
9d71542ee4 Update JS unit test libs
Update sinon to 1.15.4.
Update karma-jasmine to 0.3.0
Update jasmine to 2.3.4

This brings a bunch of new useful functions for unit testing.
2015-07-10 11:21:47 +02:00
Morris Jobke
08afce3d7e [command] single user mode - use config object & add tests 2015-07-09 18:33:46 +02:00
Joas Schilling
85f012512e Invert the "public" to a "private" method 2015-07-07 11:30:21 +02:00
Joas Schilling
e5bc9d0619 Make it possible to import exportet app/system configs 2015-07-07 11:25:29 +02:00
Joas Schilling
d2ca3a25d3 Replace deprecated method calls 2015-07-07 11:18:25 +02:00
Joas Schilling
2b86eb0b29 Add commands to get, set and delete app config values 2015-07-07 11:18:25 +02:00
Joas Schilling
86952f88cb Add a command to import an json array into the config 2015-07-07 11:18:25 +02:00
Joas Schilling
bc084c40a6 Add a command to delete a system config 2015-07-07 11:18:25 +02:00
Joas Schilling
3608c1007e Add a command to get a config value 2015-07-07 11:18:25 +02:00
Joas Schilling
a83eac3762 Add a command to set a system config value 2015-07-07 11:18:25 +02:00
Joas Schilling
5370bba0b6 Split the system from the app config 2015-07-07 11:18:24 +02:00
Joas Schilling
16907f91ed Add tests for list config 2015-07-07 11:18:24 +02:00
Bjoern Schiessle
058d910f5e intproduce pre_addToGroup hook. we need to calculate the possible unique
targets before the user was added to the group otherwise we will always detect
a name collision
2015-07-06 17:24:05 +02:00
Thomas Müller
9120942bcf Merge pull request #16924 from owncloud/copy-recursive-polyfill
add recursive copy polyfill for storage backends
2015-07-06 17:05:36 +02:00
Vincent Petry
073e654692 Merge pull request #17304 from owncloud/fix-17265
Check if response could get generated
2015-07-06 12:29:07 +02:00
Thomas Müller
43ebf0d127 Fix unit test 2015-07-03 18:00:16 +02:00
Thomas Müller
403deb2a33 Fixing unit test execution 2015-07-03 18:00:16 +02:00
Thomas Müller
1385b1ec48 Remove OC_Appconfig 2015-07-03 18:00:16 +02:00
Thomas Müller
d3ac73c0c9 Remove OC_Log 2015-07-03 18:00:16 +02:00
Vincent Petry
3df27a01be Merge pull request #17379 from owncloud/kill-file-mapper
Remove file mapper - was only use in Windows and never worked properly
2015-07-03 17:53:47 +02:00
Vincent Petry
b45c1f76b4 Remove bogus test result
This file was created during a bogus test run that created files in the
wrong location, and was checked in by mistake.
2015-07-03 17:31:14 +02:00
Thomas Müller
f55aa856ad Remove file mapper - was only use in Windows and never worked properly 2015-07-03 15:41:29 +02:00
Robin Appelman
a0c089a1c9 add unit tests 2015-07-03 13:44:03 +02:00