aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/User/Manager.php
Commit message (Collapse)AuthorAgeFilesLines
* 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-271-4/+2
| | | | | | 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-271-17/+12
| | | | | | | | | 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>
* 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>
* spaces are allowed in useridsSimon L2023-01-101-2/+2
| | | | Signed-off-by: Simon L <szaimen@e.mail.de>
* 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>
* 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>
* Make DisplayNameCache return null if user doesn't existsCarl Schwan2022-08-161-1/+1
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Merge branch 'master' into display-name-cache-publicCarl Schwan2022-08-151-14/+16
|\ | | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
| * Fix psalm issues related to the user backendCarl Schwan2022-05-201-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | - 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-181-0/+11
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Don't check the configvalue for lastLogin which is never nullJoas Schilling2021-12-101-2/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fair use of push notificationsJoas Schilling2021-10-231-1/+6
| | | | | | | | | We want to keep offering our push notification service for free, but large users overload our infrastructure. For this reason we have to rate-limit the use of push notifications. If you need this feature, consider setting up your own push server or using Nextcloud Enterprise. Signed-off-by: Joas Schilling <coding@schilljs.com>
* Use cached user backend info for password loginJoas Schilling2021-09-141-3/+9
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* enable the user to set a primary (notification) email address (backend)Arthur Schiwon2021-09-091-0/+1
| | | | | | | - specific getters and setters on IUser and implementation - new notify_email field in provisioning API Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Hash cache keyChristopher Ng2021-08-171-2/+3
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* Migrate HintException to OCPGary Kim2021-06-301-1/+1
| | | | Signed-off-by: Gary Kim <gary@garykim.dev>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-2/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Merge pull request #26161 from ↵Joas Schilling2021-03-171-0/+36
|\ | | | | | | | | nextcloud/bugfix/noid/improve-matching-of-phonebook-searches Improve search results when only phonebook-matches can we autocompleted
| * Improve search results when only phonebook-matches can we autocompletedJoas Schilling2021-03-171-0/+36
| | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* | dont allow creating users with __groupfolders as uidRobin Appelman2021-03-161-0/+1
|/ | | | | | Fixes https://github.com/nextcloud/groupfolders/issues/338 Signed-off-by: Robin Appelman <robin@icewind.nl>
* Cache the user backend info for 300sJoas Schilling2021-02-151-1/+24
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Merge pull request #24948 from nextcloud/dependabot/composer/doctrine/dbal-3.0.0Christoph Wurst2021-01-081-3/+3
|\ | | | | Bump doctrine/dbal from 2.12.0 to 3.0.0
| * Bump doctrine/dbal from 2.12.0 to 3.0.0Christoph Wurst2021-01-081-3/+3
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | allow authenticating using urlencoded passwordsRobin Appelman2021-01-071-0/+14
|/ | | | | | this allows authenticating with passwords that contain non ascii-characters in contexts that otherwise do not allow it (http basic) Signed-off-by: Robin Appelman <robin@icewind.nl>
* Allow subscription to indicate that a userlimit is reachedMorris Jobke2020-12-021-0/+8
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Streamline user creation and deletion eventsMorris Jobke2020-11-231-4/+4
| | | | | | CreateUserEvent was the only one that didn't matched the naming scheme of BeforePASTTENSEEvent and PASTTENSEEvent. The event wasn't used at all so this just removes it again as there is BeforeUserCreatedEvent that is also available since 18. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Deprecate old user manager events for user creationMorris Jobke2020-11-041-0/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Type the \OCP\IUserManager::callForSeenUsers closure with PsalmChristoph Wurst2020-10-281-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Revert "Make sure MySQL is not saying 'this' = 'this ' is true"Roeland Jago Douma2020-04-151-1/+1
|
* Make sure MySQL is not saying 'this' = 'this ' is trueJoas Schilling2020-04-151-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-5/+5
| | | | | | | | | | | | | | | 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>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-3/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-7/+7
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-2/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Prevent creating users with existing filesJoas Schilling2019-12-041-7/+19
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add typed create user eventsChristoph Wurst2019-12-031-5/+17
| | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-221-2/+2
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Get the proper UIDRoeland Jago Douma2019-08-131-0/+5
| | | | | | | | | | | | | | | | | | | | | Some user backends (like the database backend) allow us to obtain a user case insensitive. However the UID itself is case sensitive. Example: * create a user User1 * login as User1 - This results the data/User1 folder to be created etc * now have some code somewhere that obtains the userFolder (from IRootFolder) but pas in 'uSER1' as uid - The code will check if that is a valid user. And in this case it is since User1 and uSER1 both map to the same user - However the the UID in the user object is used for the folder a new folder fill be create data/uSER1 With this PR this is avoided now. Since we obtain the real UID casing in the backend before creating the user object. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add a login chain to reduce the complexity of LoginController::tryLoginChristoph Wurst2019-05-071-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Do not allow invalid users to be createdRoeland Jago Douma2019-03-141-0/+14
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add dispatcher events to User and Group objectsJoas Schilling2019-03-011-8/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Use a case insensitive search for emailRoeland Jago Douma2018-12-201-1/+1
| | | | | | | | 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>
* Use the defined func()->count() instead of manual countingJoas Schilling2018-11-081-2/+2
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Properly escape column name in "createFunction" callMorris Jobke2018-10-161-2/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* filter null values for UserManager::getByEmailGeorg Ehrke2018-10-151-1/+5
| | | | Signed-off-by: Georg Ehrke <developer@georgehrke.com>
* Ignore case when sorting usersJohn Molakvoæ (skjnldsv)2018-05-261-2/+2
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Added total count for subadminsJohn Molakvoæ (skjnldsv)2018-05-241-0/+19
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Added disabled count per groupsJohn Molakvoæ (skjnldsv)2018-05-241-6/+42
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>