aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/User
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Do not dispatch postSetPassword when setPassword failsLouis Chemineau2022-05-051-6/+10
| | | | | | Also Improve error message when setPassword fails Signed-off-by: Louis Chemineau <louis@chmn.me>
* Merge pull request #32082 from nextcloud/directory-content-lazy-ownerVincent Petry2022-04-251-0/+149
|\ | | | | use a lazy user for the file owner when listing a directory
| * Use a lazy user for the file owner when listing a directoryRobin Appelman2022-04-221-0/+149
| | | | | | | | | | | | | | Only getUID and getDisplayName are called on the file owner objects anyway and we can get this information often without DB request Signed-off-by: Robin Appelman <robin@icewind.nl>
* | cache display names in local memory before external memcacheRobin Appelman2022-04-221-6/+14
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update cache when display name changeCarl Schwan2022-04-221-1/+12
| | | | | | This improve the correctness of the data Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Cache display nameCarl Schwan2022-04-221-0/+66
| | | | | | | | This should saves some query in the share backend when displaying the owner and it's not important if the display name is 10 minutes outdated as it is very rare that this gets changed. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Migrate from ILogger to LoggerInterface in lib/privateCôme Chilliet2022-03-241-18/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #31218 from ↵Joas Schilling2022-03-021-18/+13
|\ | | | | | | | | nextcloud/techdebt/noid/use-cache-also-for-userbackend-getpassword Use the cache also for UserBackend::getPassword
| * Update cache when setting the passwordJoas Schilling2022-02-181-1/+7
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
| * Use the cache also for UserBackend::getPasswordJoas Schilling2022-02-161-17/+6
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Delay loading user preferences until we need themJoas Schilling2022-02-281-8/+12
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Only setupFS when we have to copy the skeletonJoas Schilling2022-02-251-4/+4
|/ | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update Session.phpMarek-Wojtowicz2022-01-121-1/+1
| | | | | | The http headers according to rfc 2616 is iso-8859-1. This patch fixes the behavior when non-ascii characters are present in the header. Signed-off-by: Marek Wójtowicz <Marek.Wojtowicz@agh.edu.pl>
* Don't check the configvalue for lastLogin which is never nullJoas Schilling2021-12-101-2/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Remove default token which is deprecated since Nextcloud 13Joas Schilling2021-12-011-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix type errorsCôme Chilliet2021-11-231-4/+5
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix missing token updateJoas Schilling2021-11-121-0/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>