Commit graph

205 commits

Author SHA1 Message Date
Côme Chilliet
ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +02:00
Côme Chilliet
8bcc2d352e chore: Fix missing template parameter for IEventListener
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-30 10:57:15 +01:00
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Joas Schilling
d8ffbed2c2
fix(workflows): Finish password confirmation
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-11-16 06:25:42 +01:00
Arthur Schiwon
93505b2cdd fix(workflowengine): use andWhere() not second where()
- an unconditional where() condition is added right before
- fixes also wrongly named methods in the Exception message

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-11-13 14:47:47 +01:00
Joas Schilling
997a1c46fb
fix(workflow): Fix "Call to a member function getUID() on null" with appdata
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-11-13 09:00:40 +01:00
Jonas
7441ce2b11
enh(IMountManager): Add method to get MountPoint from CachedMountInfo
Signed-off-by: Jonas <jonas@freesources.org>
2023-10-23 20:50:24 +02:00
Jonas
9193d8be40
fix(isLegitimatedForUserId): Setup mountpoints to check file access
This fixes workflows on groupfolders, as it will consider access to
files in groupfolders.

It also fixes false positives where access to files was limited by other
means not taken into account before, e.g. access control.

For postDelete events, check for permissions of the parent folder
instead, as the file itself no longer exists.

Fixes: nextcloud/flow_notifications#71

Signed-off-by: Jonas <jonas@freesources.org>
2023-10-23 20:47:16 +02:00
Côme Chilliet
0a9371f99f
Migrate applications away from deprecated ILogger
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-21 11:57:21 +02:00
Côme Chilliet
bfe42de8f8
Merge pull request #38604 from fsamapoor/replace_strpos_calls_in_workflowengine_app
Refactors "strpos" calls in /apps/workflowengine
2023-08-07 09:10:43 +02:00
Joas Schilling
aa039c986a
fix(workflowengine): Remove legacy event (deprecated since 17)
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-19 17:37:34 +02:00
Julius Härtl
06d80ba809 fix: Avoid failing with duplicate checks
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-07-12 16:54:13 +02:00
Faraz Samapoor
9d15e6e21d Fixes "PossiblyFalseArgument" notices.
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2023-07-03 13:13:11 +03:30
Faraz Samapoor
5db241b942 Refactors "strpos" calls in /apps/workflowengine to improve code readability.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2023-07-03 13:13:11 +03:30
jld3103
efb7448cd2
workflowengine: Stop using a service alias for controller
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-06-19 09:43:44 +02:00
Joas Schilling
9ba091b348
fix(workflow): Check tag attribute
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-03-16 08:44:41 +01:00
Joas Schilling
5bc86dd6ac
techdebt(workflowengine): Remove transition event classes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-03-03 15:33:17 +01:00
Joas Schilling
15fc42966c
Also check the scope when reading operations from the database
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-23 06:13:00 +01:00
Joas Schilling
c6700150d5
Validate the scope when validating operations
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-02-23 06:13:00 +01:00
Julius Härtl
aebf654214
perf(workflowengine): Cache query that is performed on every request
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-02-10 14:33:07 +01:00
Robin Appelman
83cc8202b8
remove file exists check from cacheAndReturnMimeType
the method is only called if the file exists already

a check against storing the fallback mimetype is added as a safety instead

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-12-20 13:28:40 +01:00
Robin Appelman
c5a8246742
use mimetype from cache for workflow if available
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-12-20 13:28:33 +01:00
Côme Chilliet
a0f6a6545b
Use TimedJob from OCP instead of OC
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-05 10:13:34 +01:00
Côme Chilliet
9ba9f9a7dc
Make sure to not pass null to DateTime::createFromFormat
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-14 16:23:50 +01:00
Carl Schwan
d5c23dbb9f Move CappedMemoryCache to OCP
This is an helpful helper that should be used in more place than just
server and this is already the case with groupfodlers, deck, user_oidc
and more using it, so let's make it public

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-14 15:54:31 +02:00
Carl Schwan
30d7763edc Use SettingsSection in workflowengine settings
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-05-31 08:38:50 +00:00
Carl Schwan
ec6b83cc18 Add stricter psalm type for CappedMemoryCache
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-12 15:06:18 +02:00
Louis Chemineau
64951ec14e Change script loading order in worflowengine
Fix: https://github.com/nextcloud/server/issues/31709

Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-03-31 10:33:50 +02:00
Côme Chilliet
ccab35f23f
Fix similar potential problems with fetchOne loops
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-08 12:10:52 +01:00
Carl Schwan
cbf9064b8e
Fix psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 12:30:27 +01:00
Carl Schwan
695165260f
Add helper method in Wrapper
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 10:39:36 +01:00
Carl Schwan
0479fff37c
The storage is not static anymore
Don't call twice $cache->getId

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 10:39:36 +01:00
Carl Schwan
1f392d666a
Optimize FileSystemTags workflow for groupfolder
In https://github.com/nextcloud/server/pull/28774 we disabled the
caching for the groupfolder application since it worked due to the fact
that in groupfolders, getFileIds could be called with the same $cacheId
and path for actually different groupfolders.

This revert this change and instead add the folderId from the
groupFolder to the cacheId. This solve the issue of the uniqueness of
the cacheId inside GroupFolder. Downside is that we introduce
groupfolder specific implementation inside the server repo.

The seconf optimization is to not consider paths starting with
__groupfolders in executeCheck. This is due to the fact that files in
the groupfolder application call two times executeCheck one time with
the url __groupfolder/<folderId>/<path> and the other time with <path>.
The first time will always return an empty systemTags array while the
second call will return the correct system tags.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 10:39:32 +01:00
Carl Schwan
08bf47a5de
Fix RequestURL check for cli commands
Fix https://github.com/nextcloud/files_automatedtagging/issues/526

Fix https://github.com/nextcloud/groupfolders/issues/1855

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-11 19:45:07 +01:00
John Molakvoæ (skjnldsv)
b664aad7ab
Move bundles to /dist
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2022-01-08 10:11:58 +01:00
Robin Appelman
e95745c074
fix tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-12-02 17:43:16 +01:00
Joas Schilling
7a6d559f19
Detect mimetype by content only with content
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-27 10:46:44 +02:00
Arthur Schiwon
7d7ef1d2e6
fixes an undefined index when getAccessList returns an empty array
- [] is a valid return value that should be honored as having no access

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-10-22 22:42:25 +02:00
Richard Steinmetz
8bd8e97181
Do not cache file ids in FileSystemTags inside group folders
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2021-09-14 15:10:44 +02:00
Daniel Kesselberg
7492b3c24f
Set alias for result of cast column function
On OCI an expression like to_char(events) end up as $row['to_char(events)'] in the query result.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2021-08-16 14:38:19 +02:00
Vincent Petry
15a62c5237
Make "name" column nullable in workflow operations
The "name" column is now unused and the code is always inserting an
empty string. While this works with most databases, Oracle complains
because an empty string is equivalent to null.

To fix this, the column definition is changed to allow null values now.

Also added some logging in case of database exceptions, because without
this nothing would be logged to detect the above problem.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-08-10 11:19:15 +02:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
szaimen
35d978c2fc Rename External storages to External storage
Signed-off-by: szaimen <szaimen@e.mail.de>
2021-05-20 12:13:04 +02:00
François Freitag
d887851183 Prefer string $file over 1-element array in script()
The string syntax is more obvious. There should be one (and preferably
only one) way of doing things.

Signed-off-by: François Freitag <mail@franek.fr>
2021-05-18 09:24:05 +02:00
Christoph Wurst
11e2286a82
Merge pull request #25588 from nextcloud/techdept/custom-psr-logger
Migrate custom loggers to PSR
2021-03-05 09:46:07 +01:00
Roeland Jago Douma
bc961baa40 Move some settings over to the IInitialState
The old one has been deprecated. Part one of many.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-03-02 21:11:56 +01:00
dependabot-preview[bot]
eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +01:00
Christoph Wurst
77a8ba0d11
Migrate WFE to the new PSR logger
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-11 16:17:37 +01:00
Christoph Wurst
c1d4f8161b
Migrate internal classes to the OCP db col types
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-12 14:09:13 +01:00
Morris Jobke
24d436cb60
Remove unneeded casts that were found by Psalm
In preparation of the update of Psalm from 4.2.1 to 4.3.1+ (see https://github.com/nextcloud/server/pull/24521)

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2021-01-11 13:14:41 +01:00