Commit Graph

10660 Commits

Author SHA1 Message Date
Morris Jobke 73c2ad293b
Merge pull request #23998 from nextcloud/backport/23937/stable20
[stable20] Use query builder instead of OC_DB in OC\Files\*
2020-11-10 10:26:04 +01:00
Morris Jobke bf6aa03eb3
Merge pull request #23995 from nextcloud/backport/23741/stable20
[stable20] Unlock when promoting to exclusive lock fails
2020-11-10 10:16:34 +01:00
Roeland Jago Douma 8edc29bfef
Merge pull request #23955 from nextcloud/backport/23938/stable20
[stable20] Replace some usages of OC_DB in OC\Share\* with query builder
2020-11-10 08:59:54 +01:00
Joas Schilling adcc942553 Use query builder instead of OC_DB in OC\Files\*
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-09 11:01:09 +00:00
John Molakvoæ (skjnldsv) 0c4297cee9 Make sure root storage is valid before checking its size
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2020-11-09 10:05:54 +00:00
Ashod Nakashian 7298d037b2 Unlock when promoting to exclusive lock fails
In certain cases changeLock to EXCLUSIVE fails
and throws LockedException. This leaves the
file locked as SHARED in file_put_contents,
which prevents retrying (because on second
call file_put_contents takes another SHARED
lock on the same file, and changeLock doesn't
allow more than a single SHARED lock to promote
to EXCLUSIVE).

To avoid this case, we catch the LockedException
and unlock before re-throwing.

Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-11-09 10:03:15 +00:00
Morris Jobke 20885847c8
Merge pull request #23971 from nextcloud/backport/23936/stable20
[stable20] Use query builder instead of OC_DB in trashbin
2020-11-09 10:27:29 +01:00
Daniel Kesselberg a01da78f1d
Add explicit typecast for $value.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-11-09 10:13:36 +01:00
Joas Schilling b3dfa9290d Update parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-07 15:57:47 +00:00
Joas Schilling 2e3cffc53b Make sure Oracle always casts everything in the best way
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-07 15:57:46 +00:00
Joas Schilling c71cc6824e Use Query builder function
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-07 15:57:45 +00:00
Joas Schilling d111e88d4c Fix order of GREATEST for Oracle
As per https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions060.htm
Oracle uses the first value to cast the rest or the values.
So when the first value is a plain int, instead of doing the math,
it will cast the expression to int and continue with a potential 0.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-07 15:57:44 +00:00
Roeland Jago Douma 71de05f775
Merge pull request #23951 from nextcloud/backport/23922/stable20
[stable20] Improve query type detection
2020-11-07 10:49:06 +01:00
Roeland Jago Douma bac92bb814
Merge pull request #23954 from nextcloud/backport/23943/stable20
[stable20] Fix iLike() falsely turning escaped % and _ into wildcards
2020-11-07 09:18:23 +01:00
Roeland Jago Douma a5c6abc93a
Merge pull request #23948 from nextcloud/backport/23940/stable20
[stable20] Skip already loaded apps in loadApps
2020-11-07 07:59:52 +01:00
Joas Schilling 73a09a4f54 Replace some usages of OC_DB in OC\Share\* with query builder
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-06 21:43:46 +00:00
Joas Schilling 3a7e2fbff1 Fix iLike() falsely turning escaped % and _ into wildcards
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-06 21:29:48 +00:00
Morris Jobke f8b550dab7
Merge pull request #23935 from nextcloud/backport/23921/stable20
[stable20] Fix casting of integer and boolean on Oracle
2020-11-06 22:24:31 +01:00
Joas Schilling 3ffd31353c Improve query type detection
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-06 21:20:44 +00:00
Morris Jobke a2c9915ca4
Merge pull request #23924 from nextcloud/backport/23920/stable20
[stable20] Bearer must be in the start of the auth header
2020-11-06 22:10:01 +01:00
Roeland Jago Douma ef5cee12d1 Skip already loaded apps in loadApps
Otherwise you might end up calling a lot of functions unneeded.
And while the individual calls are cheap if you multiply them by 20k
they still get somewhat expensive.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-11-06 21:01:12 +00:00
Joas Schilling 990bb07002
Cast bool things to numbers as that is how they are stored in the database
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-06 13:36:57 +01:00
Joas Schilling 2b0b57d304 Fix casting to integer on Oracle
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-06 10:42:15 +00:00
Roeland Jago Douma c9bf32b454 Bearer must be in the start of the auth header
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-11-06 08:21:30 +00:00
Tobias Assmann 2b55a90ae4
fix: also remove use statement of UserCreatedEvent
Signed-off-by: Tobias Assmann <tobias.assmann@ecsec.de>
2020-11-05 23:08:14 +01:00
Tobias Assmann 6d1ecf2218
fix: no more translation from postCreateUser hook to UserCreatedEvent anymore, as event is already emitted in user manager
Signed-off-by: Tobias Assmann <tobias.assmann@ecsec.de>
2020-11-05 23:08:04 +01:00
Morris Jobke 23d3586865 No need to check if there is an avatar available, because it is generated on the fly nowadays
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-11-02 18:10:23 +00:00
Morris Jobke 24e93bbba4 Fetch the logger and system config once for all query builder instances
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-30 06:40:43 +00:00
Christoph Wurst c509410b1d Type the \OCP\IUserManager::callForSeenUsers closure with Psalm
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-28 19:08:14 +00:00
Morris Jobke 017a3f86c2 Use lib instead if core as l10n module in OC_Files
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-27 16:30:26 +00:00
Morris Jobke 2b12d71a0d
Merge pull request #23641 from nextcloud/backport/23602/stable20
[stable20] Fix updates of NULL appconfig values
2020-10-25 21:38:49 +01:00
Roeland Jago Douma 0b46ebe3c6
Merge pull request #23611 from nextcloud/backport/23606/stable20
[stable20] Only use index of mount point when it is there
2020-10-24 10:53:45 +02:00
Roeland Jago Douma 1cc6a0f8e3 Fix updates of NULL appconfig values
The comparisson of NULL is a bit special.
So we need to handle this a tad beter else it might not replace NULL
values. or allow you to set NULL values on updates.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-10-23 08:45:29 +00:00
Julius Härtl 367a7bd87e Only retry fetching app store data once every 5 minutes in case it fails
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-10-22 14:14:49 +00:00
Joas Schilling 2160dc9583 Only use index of mount point when it is there
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-21 18:46:13 +00:00
Morris Jobke 41090d0faa
Merge pull request #23205 from nextcloud/backport/23012/stable20
[stable20] Make BeforeTemplateRenderedEvent aware of the actual response
2020-10-19 10:15:22 +02:00
Morris Jobke cbde9d878f
Merge pull request #23514 from nextcloud/backport/23508/stable20
[stable20] fixes potential passing of null to getUserGroupIds
2020-10-19 10:14:06 +02:00
Morris Jobke e95a1420f1
Clear cached app config while waiting for the SCSSCache to finish processing the file
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-16 15:46:59 +02:00
Arthur Schiwon a615e7dcfa fixes potential passing of null to getUserGroupIds
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-10-16 13:01:06 +00:00
Morris Jobke 2dcf50cd78 SCSSCacher - Lock should not be removed
This is within the failed lock acquiring branch. So the lock is free by another process and should not be removed because the cached file (that was created by the process having the lock) appeared on the filesystem.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-16 11:27:36 +00:00
Morris Jobke 96e08a508e Provide log statements for SCSS cache
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-10-16 07:50:21 +00:00
Christoph Wurst 3a3d7ea6cd Type the authentication listeners
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-15 22:34:18 +00:00
Robin Windey 06895ef8cc Fix typo 'shared' 2020-10-12 18:08:36 +00:00
Joas Schilling d68d62f052 Make sure getUsersFavoritingObject can be run without a user
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-07 11:10:38 +00:00
Roeland Jago Douma 1f3e3e782f Use the correct l10n for activities
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-10-07 09:37:23 +00:00
Morris Jobke 21f00069fe
Merge pull request #23213 from nextcloud/backport/22937/stable20
[stable20] Allow configuring the activity update interval of token
2020-10-06 16:07:54 +02:00
Roeland Jago Douma ca32ee1a65
Merge pull request #23220 from nextcloud/backport/23215/stable20
[stable20] Only run the query to get the account data once
2020-10-06 14:46:06 +02:00
Joas Schilling 851acc1d74 Only run the query to get the account data once
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-06 10:48:24 +00:00
Roeland Jago Douma e0bc29d907 Allow configuring the activity update interval of token
On some systems with a lot of users this creates a lot of extra DB
writes.
Being able to increase this interval helps there.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-10-06 08:04:12 +00:00
Julius Härtl bc0a429822 Add acutal response to BeforeTemplateRenderedEvent
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-10-05 19:53:05 +00:00
Robin Appelman aec422a874 add mount point to quota warning message
makes it more clear to the user what the quota applies to

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-10-04 11:05:24 +00:00
Roeland Jago Douma fa4cd4435b
Merge pull request #23089 from nextcloud/backport/23074/stable20
[stable20] Do not match sharees on an empty email address
2020-10-01 19:29:39 +02:00
Roeland Jago Douma 2e87668f77
Merge pull request #23092 from nextcloud/backport/23083/stable20
[stable20] Generate exception to log on php errors
2020-09-29 16:38:56 +02:00
Julius Härtl 05fa5e4d9e Generate exception to log on php errors
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-29 08:17:21 +00:00
Christoph Wurst 851333edab Do not match sharees on an empty email address
When asking for sharees we compare not only UID and displayname but also
the email address. And if that matches we return the sharee as an exact
match. This logic had a flaw as in that it also matched the empty string
to users with no email address.

This is most noticeable when you disable sharee enumeration and open the
ownership transfer dialog. It suggested other users of the instance
before. This has stopped now.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-09-29 07:29:43 +00:00
Joas Schilling 71b33fb87a Show federation and email results also with exact user match unless containing @
Before when you have a user "smith" and a federated user "smith@example.com"
you could see the federation result with "smit" but not with "smith" anymore.
With most LDAP configurations and local backend setups this is disturbing and
causes issues.
The idea of not showing the email and federation on a matching user was with:
Local user registered with "smith@example.com" user id and having that same
email / cloud id in your contacts addressbook. So we now only hide those
"side results" when the search does contain an @

Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-29 07:16:12 +00:00
Roeland Jago Douma 15ff980583
Merge pull request #23029 from nextcloud/backport/23024/stable20
[stable20] Add occ command to set theming values
2020-09-28 12:24:23 +02:00
Joas Schilling 5475bb4083 Log a warning if a "lazy" initial state loads longer than 1 second
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-24 13:00:19 +00:00
Joas Schilling 87f8e1e366 Log an error if a dashboard widget loads longer than 1 second
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-24 13:00:19 +00:00
Julius Härtl 99b25ef3fe Add occ command to set theming values
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-24 12:38:53 +00:00
Joas Schilling 26603c7cdd Don't log "duplicate section" for the shared "connected-accounts" section
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-23 11:03:50 +00:00
Robin Appelman 674db6da88
add event to allow apps to overwrite user quota
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-09-17 16:32:48 +02:00
Morris Jobke ec07ca2abb
Merge pull request #22844 from nextcloud/enh/richdocumentscode-arm
Support architecture limitations for apps and allow richdocumentscode_arm64 though htaccess
2020-09-17 12:22:42 +02:00
Morris Jobke d144a84df1
Merge pull request #22903 from nextcloud/techdebt/16696/no-need-to-get-full-path-again
Do not fetch the normalized full path again if it is already available
2020-09-17 11:54:47 +02:00
Morris Jobke 063ac9d353
Do not fetch the normalized full path again if it is already available
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-09-17 09:56:45 +02:00
Roeland Jago Douma b0c04a3e0c
Merge pull request #22867 from nextcloud/shared-storage-init-less
Shared storage optimizations
2020-09-17 08:55:35 +02:00
Julius Härtl 04eb1bb949
Allow to specify supported architectures in appinfo.xml
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-17 08:55:15 +02:00
Julius Härtl 364b96d5b9
Add htaccess exception for richdocumentscode_arm64
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-17 08:55:15 +02:00
Julius Härtl 5340215871
Install richdocumentscode depending on the architecture
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-17 08:55:14 +02:00
Roeland Jago Douma 05edd1e5d6
Merge pull request #22890 from nextcloud/techdebt/18680/help-static-code-analysis-understand-code
Help static code analysis to understand code
2020-09-17 08:51:20 +02:00
Morris Jobke 1bed77c5fc
Merge pull request #22888 from nextcloud/techdebt/18680/remove-unused-code
Remove not needed semicolon and PHPDoc hint
2020-09-16 20:44:46 +02:00
Daniel Kesselberg 096fe20611
Help static code analysis to understand code.
It adds proper type hints to private namespace to allow private namespace methods.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-09-16 16:37:17 +02:00
Morris Jobke 6b4998f20f
Merge pull request #22884 from nextcloud/phpdoc/21873/define-deprecated-version
Specific version for @deprecated PHPDoc
2020-09-16 16:25:11 +02:00
Morris Jobke d3680e682a
Remove not needed semicolon and PHPDoc hint
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-09-16 16:18:43 +02:00
Morris Jobke 99c9423766
Remove @suppress SqlInjectionChecker
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-09-16 15:53:56 +02:00
Morris Jobke 4cfbe0c97d
Specific version for @deprecated PHPDoc
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-09-16 15:09:00 +02:00
Robin Appelman cfde74442c
optimize View::getPath if we already know the storage id
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-09-16 13:49:07 +02:00
Robin Appelman 244fd6ae49
disable update checking for shared storages
update checking is already handled by the share source

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-09-15 16:42:40 +02:00
Joas Schilling 441adaa74a
Remove unneeded isset check
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-11 16:20:30 +02:00
Morris Jobke e269f15d56
Merge pull request #22234 from nextcloud/bugfix/noid/reshare-mount
Use user mount with matching shared storage only
2020-09-10 16:19:04 +02:00
Morris Jobke 3d61f7b258
Merge pull request #22774 from nextcloud/bugfix/noid/no-delay-without-ip
Don't break when the IP is empty
2020-09-10 16:11:06 +02:00
Morris Jobke 4ae8caaf28
Merge pull request #22768 from nextcloud/fix/22288/change-0-to-null-for-bmp-encoding
Change 0 to null to properly encode image to BMP if the first pixel is black
2020-09-10 15:25:08 +02:00
Joas Schilling c25063dc07
Don't break when the IP is empty
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-10 14:20:27 +02:00
Morris Jobke 9708b004f7
Merge pull request #22552 from nextcloud/bugfix/noid/opendocument-templates
Add opendocument templates to mimetype mappings
2020-09-10 12:42:29 +02:00
Morris Jobke 46525f8639
Change 0 to null to properly encode image to BMP if the first pixel is black
Ref #22288

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-09-10 12:08:01 +02:00
Joas Schilling b5a70b31c1
Don't create a deprecation log in base.php
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-10 09:03:39 +02:00
Roeland Jago Douma 6895d97cf0
Merge pull request #22520 from nextcloud/normalize-path-invalid-utf8
dont use `false` as cache key for non utf8 path in normalizePath
2020-09-09 21:52:36 +02:00
Roeland Jago Douma bb06b6cce4
Fix reading empty files from objectstorage
Since we try to do range requests this will fail hard.
However since empty files are not that interesting to read anyways we
just read from an emptry memory stream.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-09-09 20:45:13 +02:00
Morris Jobke cd563023db
Merge pull request #22657 from nextcloud/bugfix/noid/quota-trash-creation
Check if quota should be applied to path when creating directories
2020-09-09 17:37:28 +02:00
Joas Schilling e280c05053
Merge pull request #22636 from nextcloud/bugfix/noid/initial-stte-cspv3
Make sure that getConfig is still called for browsers that do not support CSPv3
2020-09-09 13:11:59 +02:00
Morris Jobke d8dea5070b
Merge pull request #22729 from nextcloud/fix/object_storage_permissions_shortcut
Run stat less often for objectstorages
2020-09-09 10:43:37 +02:00
Roeland Jago Douma 9fdeed8cc0
Run stat less often for objectstorages
When we want to get the permissions we now do stat at least 5 times for
each entry. Which is a bit much. Especially since the permssions are all
just in the database already.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-09-08 14:38:36 +02:00
Roeland Jago Douma 919a8d473b
Merge pull request #22646 from nextcloud/bugfix/mimetype-mapping
Fix detecting text/x-php mimetype and secure mimetype mapping
2020-09-08 10:41:09 +02:00
Roeland Jago Douma ac5f2914c7
Merge pull request #22641 from nextcloud/fix/credentials-store-upgrade-property-undefined
Fix undefined class property access after upgrade from 19 to 20
2020-09-08 10:26:23 +02:00
Julius Härtl 87e5fd0d2c
Check if quota should be applied to path when creating directories
This fixes an issue where the files_trashbin hierarchy of a user could
not been created as the mkdir operations were blocked by the quota
storage wrapper. Even with 0 quota, users should be able to have a
trashbin for external storages.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-08 07:33:57 +02:00
Morris Jobke 34d2ae25f7
Merge pull request #22643 from nextcloud/bugfix/noid/fix-installing-on-oracle
Fix installing on Oracle
2020-09-07 20:55:50 +02:00
Julius Härtl 5e4303b1fe
Properly add both mimetypes to secure mimetype mapping
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-09-07 16:42:11 +02:00
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
Christoph Wurst adf100a42f
Fix undefined class property access after upgrade from 19 to 20
The serialized data in 19 has one property less and this was not
considered in the code. Hence adding a fallback. Moreover I'm changing
the deserialization into an array instead of object, as that is the
safer option.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-09-07 13:31:24 +02:00
Joas Schilling 50230847ce
Warn about adding NotNull columns with nullable default
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-07 13:14:49 +02:00