Commit Graph

61 Commits (jtr/fix-public-exceptions-http-codes)

Author SHA1 Message Date
Ferdinand Thiessen 1c85548f86
feat(AppConfig): cache app config in local cache if available
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-08-18 13:24:18 +07:00
Maxence Lange 33bff30e1d feat(lexicon): moving out from unstable
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2025-07-24 15:56:33 +07:00
Ferdinand Thiessen 5981b7eb51
chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +07:00
Joas Schilling 394febb5d9
fix(userconfig): Don't fail the precondition if the value is not set at all
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-11-19 18:02:22 +07:00
Maxence Lange 5b4f1904c0 feat(user-prefs): renaming to IUserConfig
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-11-18 20:11:31 +07:00
Maxence Lange 6afc8552b7 feat(user-prefs): switching to NCU/
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-11-18 20:11:31 +07:00
Maxence Lange 7c04818c5c feat(user-prefs): iterator instead of array on search
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-11-18 20:11:31 +07:00
Maxence Lange e73513bdd1 fix(user-prefs): adding sensitive and indexed as flags
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-11-18 20:11:31 +07:00
Maxence Lange 65e24f7def feat(user-prefs): IUserPreferences
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-11-18 20:11:31 +07:00
provokateurin 9836e9b164
chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +07:00
Joas Schilling dcd97e1234
fix(config): Throw PreconditionException always when it didn't match
Previously even when the precondition did not match, the call "passed"
when the after value was the expected one. This however can lead to
race conditions, duplicate code excutions and other things.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-09-13 09:20:08 +07:00
Ferdinand Thiessen bdce5921f6
chore(IConfig): `getUsersForUserValue` is returning a list
It is returning a list of strings so adjust the return typing
to reflect this (`list<string>` instead of `array`).

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-02 12:27:06 +07:00
Daniel Kesselberg af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +07:00
Joas Schilling 829f2b9bc7
fix(db): Promote the use of `getDatabaseProvider` to reduce the impage of removed upstream platforms
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:14 +07:00
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +07:00
Christoph Wurst b8868e2652
fix(config): Make sure user keys are strings
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-03-19 18:27:53 +07:00
Maxence Lange f7d0c74b10 lazy AppConfig
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-01-15 15:45:13 +07:00
Julius Härtl 3cd1d74a81
fix: Only apply cast if needed when searching users for value
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-11-30 20:51:48 +07:00
Julien Veyssier 361e69f19f
fix mistake in db query to delete a user config value
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-07-27 16:45:10 +07: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 +07:00
Carl Schwan 8bbdd9ea0c Cleanup AllConfig
- Port to QueryBuilder
- More typing when possible
- Import classes with 'use'

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-04-22 16:03:29 +07:00
Julius Härtl 7fbd93b2ad
Additional index on oc_preferences to make sure that gettingh values without a user filter is fast
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-04-19 12:37:36 +07:00
Côme Chilliet ddae16d480
Add specific psalm-return for getAllUserValues
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

Co-authored-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-24 11:16:44 +07:00
Côme Chilliet a6eb7dc676
Fix signatures and null $userId corner case
Configuration values are sometimes queried when there is no user in
 session, so $userId is null and we just want to return the default

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-24 11:16:44 +07:00
Côme Chilliet d630af4ca8
Add a new method getAllUserValues($userId) to IConfig
The method was already there in AllConfig but private

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-24 11:16:37 +07:00
Julius Härtl c92ac34711 Use proper app id (settings instead of core)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-12-13 19:20:10 +07:00
Joas Schilling 0877d62c47 Make sure strtolower only receives a string to satisfy psalm
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-13 19:20:10 +07:00
Joas Schilling ae36526978
Always store and compare the email address as lower case
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-10 15:01:27 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Christoph Wurst d9015a8c94
Format code to a single space around binary operators
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-10-05 20:25:24 +07:00
Joas Schilling 441adaa74a
Remove unneeded isset check
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-09-11 16:20:30 +07:00
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +07:00
MichaIng 10a98f9f41
Define getSystemValueBool/Int/String function default parameter with correct type
Signed-off-by: MichaIng <micha@dietpi.com>
2020-04-29 14:19:52 +07:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +07:00
Christoph Wurst 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +07:00
Christoph Wurst 41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +07:00
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +07:00
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +07:00
Christoph Wurst df9e2b828a
Fix mismatching docblock return types
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-06 16:38:25 +07:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07:00
Joas Schilling a11ef5134c
Add methods to get casted system values
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-02-22 08:25:41 +07:00
Roeland Jago Douma 03fe2b3b81
Use a case insensitive search for email
Fixes #7084
Now entering wrongly cased email (roeland@ instead of Roeland@) for
password reset etc. Will also work.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-20 14:19:35 +07:00
Roeland Jago Douma 431750828e
Store setUserValue as string in cache
We cache the values we set in the setUserValue function.
However since the values are strings in the database we check if a value
is equal with string comparison

Now if the function was called with a $value of int or float. It would
be stored in the DB (and thus converted to string) and in the cache (not
converted thus as int/float).

Now if another call comes in that sets it to the same value (I'm looking
at you LDAP!). The check would fail since we would be comparing
int/float to string which fails by definition.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-19 12:57:48 +07:00
Roeland Jago Douma 1e7b20f615
Remove IAppConfig::setValue
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-01-17 21:41:57 +07:00
Roeland Jago Douma 09f8a755ec
Remove IAppConfig::getValue
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-01-17 21:41:56 +07:00
Roeland Jago Douma ee2617d88c
Simple IAppConfig deprecations
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-01-17 21:03:04 +07:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +07:00
Roeland Jago Douma 5f227bd93b
More phpstorm inspection fixes
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-07-24 11:39:29 +07:00
Christoph Wurst 012708e1ba Merge pull request #3023 from nextcloud/issue-2915-filter-out-sensitive-appconfigs
Filter out sensitive appconfig values
2017-01-17 11:01:42 +07:00
Joas Schilling ce7836378c
Filter out sensitive appconfig values
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-01-11 11:42:36 +07:00