summaryrefslogtreecommitdiffstats
path: root/lib/private/User
Commit message (Collapse)AuthorAgeFilesLines
* fix(cache): Remove displayname cache entry on deleteJoas Schilling2023-08-281-0/+6
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix(dav): Fix avatar size in system address bookJoas Schilling2023-05-261-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* feat(users): Store and load a user's managerChristoph Wurst2023-05-122-0/+33
| | | | | Co-Authored-By: hamza221 <hamzamahjoubi221@gmail.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* fix(user): Can change display nameChristopher Ng2023-05-041-1/+1
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* fix(dav): Abort requests with 429 instead of waitingJoas Schilling2023-05-031-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update version number in since and deprecated annotationsCôme Chilliet2023-04-271-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Make code clearer and bump @ deprecated annotationsCôme Chilliet2023-04-271-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Split new method in a new group backend interfaceCarl Schwan2023-04-272-5/+3
| | | | | | Better for backward compatibility, also move new interfaces to nc 26 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Optimize retrieving display name when searching for users in a groupCarl Schwan2023-04-272-20/+29
| | | | | | | | | This is recurrent scenario that we are searching for users and then for each users we fetch the displayName. This is inefficient, so instead try to do one query to fetch everything (e.g. Database backend) or use the already existing DisplayNameCache helper. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Use typed version of IConfig::getSystemValue as much as possibleCôme Chilliet2023-04-053-6/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #35561 from nextcloud/create-user-transactionJulius Härtl2023-03-151-11/+18
|\
| * Create the database user in a transactionThomas Citharel2023-03-151-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In OC\User\Manager::createUserFromBackend the newly created user is read using getUserObject($uid, $backend) but that can cause causal read issues (wrote in DB primary, not yet in secondary). In OC\User\Database user backend the user cache is unset after the insert, so it can't be used by getRealUID() (which is called by getUserObject()). To avoid that we make sure the user cache is repopulated in a transaction. Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* | Merge pull request #37227 from nextcloud/h1-dav-brute-force-protectionArthur Schiwon2023-03-151-10/+16
|\ \ | |/ |/| chore: use local variable for remote address
| * chore: use local variable for remote addressDaniel Kesselberg2023-03-101-10/+16
| | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | fix: Recalculate storage statistics on updating the quotaJulius Härtl2023-03-061-0/+1
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | also cache backend for user in memory instead of always going to redisRobin Appelman2023-02-101-1/+2
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix setQuota on User on 32bitsCôme Chilliet2023-02-071-2/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* composer run cs:fixCôme Chilliet2023-01-201-1/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* spaces are allowed in useridsSimon L2023-01-101-2/+2
| | | | Signed-off-by: Simon L <szaimen@e.mail.de>
* Merge pull request #34772 from nextcloud/fix/clean-ldap-access-factory-usageCôme Chilliet2022-12-201-10/+10
|\ | | | | Make sure to use AccessFactory to create Access instances and use DI
| * Merge branch 'master' into fix/clean-ldap-access-factory-usageCôme Chilliet2022-11-211-4/+2
| |\ | | | | | | Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
| * | Fix return type for countUsers methodCôme Chilliet2022-10-251-10/+10
| | | | | | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | | Validate if the user part of a "cloud id" can even be a valid user idJoas Schilling2022-12-091-26/+44
| | | | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | | feat: add event for failed loginsRoeland Jago Douma2022-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Apps might also like to know about failed logins. This adds that event. The private interface changes are backwards compatible so all should be fine. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | | Remove potential mismatching dav session data during loginJulius Härtl2022-11-221-0/+1
| |/ |/| | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Fix errors from PHP 8.2 testingCôme Chilliet2022-11-141-3/+1
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Fix unsuccessful token login logged as errorChristoph Wurst2022-11-071-1/+1
|/ | | | | | | | | | | | | The condition of a non-existent login token can happen for concurrent requests. Admins can not do anything about this. So this is to be expected to happen occasionally. This event is only bad if none of the requests is able to re-acquire a session. Luckily this happens rarely. If a login loop persists an admin can still lower the log level to find this info. But a default error log level will no longer write those infos about the failed cookie login of one request. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* LDAP to no register new users when outside of fair use or over limitsArthur Schiwon2022-10-181-11/+6
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Fix avatar cleanup on user deleteJoas Schilling2022-09-191-5/+5
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Merge pull request #34073 from nextcloud/login-email-filterVincent Petry2022-09-161-0/+3
|\ | | | | dont try email login if the provider username is not a valid email
| * dont try email login if the provider username is not a valid emailRobin Appelman2022-09-141-0/+3
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Merge pull request #33793 from nextcloud/fix/noid/rtrim-cloud-idMaxence Lange2022-09-151-2/+2
|\ \ | |/ |/| rtrim cloudId url earlier
| * rtrim url earlierMaxence Lange2022-09-011-2/+2
| | | | | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* | I dug into it again, and the issue is much simpler than I previously though.Louis Chemineau2022-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | - LDAP has an email address with capital letters - NC store this address in lower case - When the user logs in, we compare the [stored email with the new lower case email](https://github.com/nextcloud/server/blob/master/lib/private/AllConfig.php#L259-L261) before storing it. Here, both email will be the same, so we won't store the new email address with upper case letters. Which is what we want. - We then [compare emails as they are before triggering an event](https://github.com/nextcloud/server/blob/master/lib/private/User/User.php#L202-L204), they won't match, so the user will receive an email signaling an email change every time he logs in. The fix is to compare the old email with the new lower case email before sending the event. Signed-off-by: Louis Chemineau <louis@chmn.me>
* | Merge pull request #33625 from nextcloud/fix/33572/add-userVincent Petry2022-09-012-1/+6
|\ \ | |/ |/| Fix creation of new user and display the correct error message
| * Fix creation of new user and display the correct error messageChristopher Ng2022-08-222-1/+6
| | | | | | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* | Merge pull request #33780 from nextcloud/enh/noid/cloud-id-cliblizzz2022-09-011-0/+3
|\ \ | | | | | | filter index.php from cloudId
| * | filter index.php from cloudIdMaxence Lange2022-08-311-0/+3
| |/ | | | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* / Log if cookie login failed with token mismatch or session unavailabilityChristoph Wurst2022-08-311-0/+8
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make DisplayNameCache return null if user doesn't existsCarl Schwan2022-08-163-4/+4
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Merge branch 'master' into display-name-cache-publicCarl Schwan2022-08-157-42/+186
|\ | | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
| * only update last login timestamp with minute percisionRobin Appelman2022-07-201-4/+9
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * 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>
| * Merge pull request #32973 from nextcloud/cleanup/avatar-codeCarl Schwan2022-07-112-0/+127
| |\ | | | | | | Cleanup avatar related code
| | * Make Color class publicCarl Schwan2022-07-052-4/+6
| | | | | | | | | | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
| | * Cleanup avatar related codeCarl Schwan2022-06-222-0/+125
| | | | | | | | | | | | | | | | | | | | | | | | - Move event listener to new event handling - Add typing almost everywhere - Fix inconsistent interface parameter Signed-off-by: Carl Schwan <carl@carlschwan.eu>
| * | Do not save invalid display name to the databaseChristopher Ng2022-06-281-0/+4
| |/ | | | | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
| * Keep non default protocol in cloud idJoas Schilling2022-06-091-7/+1
| | | | | | | | | | | | | | | | | | When there is no protocol on the cloud id, we assume it's https:// But this means that when an http:// server currently sends an OCM invite to another server, the protocol is striped and the remote instance will try to talk back to https:// which might not be available. Signed-off-by: Joas Schilling <coding@schilljs.com>
| * Fix psalm issues related to the user backendCarl Schwan2022-05-205-31/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | - Reflect the actual return value returned by the implementation in the the interface. E.g. IUser|bool -> IUser|false - Remove $hasLoggedIn parameter from private countUser implementation. Replace the two call with the equivalent countSeenUser - getBackend is nuallable, add this to the interface - Use backend interface to make psalm happy about call to undefined methods. Also helps with getting rid at some point of the old implementActions Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* | expose displayname cache trough a public interfaceRobin Appelman2022-05-182-4/+13
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>