aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AllConfig.php
Commit message (Collapse)AuthorAgeFilesLines
* fix(config): Throw PreconditionException always when it didn't matchJoas Schilling2024-09-131-3/+3
| | | | | | | | 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>
* chore(IConfig): `getUsersForUserValue` is returning a listFerdinand Thiessen2024-09-021-2/+2
| | | | | | | 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>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-7/+7
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* fix(db): Promote the use of `getDatabaseProvider` to reduce the impage of ↵Joas Schilling2024-07-191-3/+2
| | | | | | removed upstream platforms Signed-off-by: Joas Schilling <coding@schilljs.com>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-29/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix(config): Make sure user keys are stringsChristoph Wurst2024-03-191-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* lazy AppConfigMaxence Lange2024-01-151-3/+8
| | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* fix: Only apply cast if needed when searching users for valueJulius Härtl2023-11-301-2/+11
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* fix mistake in db query to delete a user config valueJulien Veyssier2022-07-271-2/+2
| | | | Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
* Move CappedMemoryCache to OCPCarl Schwan2022-07-141-1/+1
| | | | | | | | 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>
* Cleanup AllConfigCarl Schwan2022-04-221-69/+64
| | | | | | | | - Port to QueryBuilder - More typing when possible - Import classes with 'use' Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Additional index on oc_preferences to make sure that gettingh values without ↵Julius Härtl2022-04-191-0/+4
| | | | | | a user filter is fast Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Add specific psalm-return for getAllUserValuesCôme Chilliet2022-01-241-0/+1
| | | | | | | 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>
* Fix signatures and null $userId corner caseCôme Chilliet2022-01-241-5/+5
| | | | | | | 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>
* Add a new method getAllUserValues($userId) to IConfigCôme Chilliet2022-01-241-3/+3
| | | | | | The method was already there in AllConfig but private Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Use proper app id (settings instead of core)Julius Härtl2021-12-131-2/+2
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Make sure strtolower only receives a string to satisfy psalmJoas Schilling2021-12-131-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Always store and compare the email address as lower caseJoas Schilling2021-12-101-3/+12
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-051-7/+7
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove unneeded isset checkJoas Schilling2020-09-111-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-241-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Define getSystemValueBool/Int/String function default parameter with correct ↵MichaIng2020-04-291-3/+3
| | | | | type Signed-off-by: MichaIng <micha@dietpi.com>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-3/+3
| | | | | | | | | | | | | | | 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>
* Use elseif instead of else ifChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-091-0/+1
| | | | | | For PSR2 Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-15/+15
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix mismatching docblock return typesChristoph Wurst2020-03-061-3/+9
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-2/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add methods to get casted system valuesJoas Schilling2019-02-221-0/+36
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Use a case insensitive search for emailRoeland Jago Douma2018-12-201-0/+32
| | | | | | | | 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>
* Store setUserValue as string in cacheRoeland Jago Douma2018-03-191-2/+2
| | | | | | | | | | | | | | | | 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>
* Remove IAppConfig::setValueRoeland Jago Douma2018-01-171-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Remove IAppConfig::getValueRoeland Jago Douma2018-01-171-2/+2
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Simple IAppConfig deprecationsRoeland Jago Douma2018-01-171-3/+3
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update license headersMorris Jobke2017-11-061-0/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* More phpstorm inspection fixesRoeland Jago Douma2017-07-241-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Merge pull request #3023 from ↵Christoph Wurst2017-01-171-1/+1
|\ | | | | | | | | nextcloud/issue-2915-filter-out-sensitive-appconfigs Filter out sensitive appconfig values
| * Filter out sensitive appconfig valuesJoas Schilling2017-01-111-1/+1
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | remove non required sql requestsLoki30002017-01-101-3/+8
|/ | | | | ``` SELECT `appid`, `configkey`, `configvalue` FROM `preferences` WHERE `userid` = ''; ```
* Use getvalue to fetch the valueRoeland Jago Douma2016-11-161-5/+4
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Don't update value if it is already set to the same valueMorris Jobke2016-11-161-1/+4
| | | | | | | | * this PR makes sure to warm up the cache for that user * then the logic within the "if is in cache" code can be used to reduce needed queries * inspired by @andreas-p - https://github.com/nextcloud/server/pull/2128 Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use cache to determine if value need to be updatedRoeland Jago Douma2016-10-131-0/+19
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update with robinJoas Schilling2016-07-211-1/+1
|
* Fix othersJoas Schilling2016-07-211-2/+4
|
* Remove duplicate database connect logic in mysql setupRobin Appelman2016-07-121-0/+4
|
* Capped cache for user configJörn Friedrich Dreyer2016-06-171-2/+4
|
* Do not allow to store boolean configs, they behave unexpected on postgresJoas Schilling2016-06-061-2/+7
|
* Update license headersLukas Reschke2016-05-261-1/+1
|