Commit Graph

44 Commits (258c919b3c2a5211b4c792c41e37d0bad8d451ea)

Author SHA1 Message Date
Daniel Kesselberg 258c919b3c
ci: migrate ocp since checker to psalm
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 year ago
Côme Chilliet f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 year ago
Côme Chilliet 341dda1de6
Merge branch 'master' into fix/clean-ldap-access-factory-usage
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2 years ago
Côme Chilliet 556e3c84e6
Fix return type for countUsers method
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 years ago
Côme Chilliet b4eeaae77d
Update lib/public/User/Backend/ICountMappedUsersBackend.php
Co-authored-by: Simon L. <szaimen@e.mail.de>
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2 years ago
Côme Chilliet 46e31d4c06
Add missing file
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 years ago
Christopher Ng d59585974e Fix creation of new user and display the correct error message
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2 years ago
Carl Schwan 812016d626 Cleanup avatar related code
- Move event listener to new event handling
- Add typing almost everywhere
- Fix inconsistent interface parameter

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
Carl Schwan 9ec0cb0a90 Fix psalm issues related to the user backend
- 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>
2 years ago
Carl Schwan 1dbe7dafe2 Fetch status in heartbeat controller only once
Store the user status inside the event instead of fetching it again

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
Julien Veyssier 0d2c2ab629
allow null password in UserLoggedInEvent
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
3 years ago
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
Joas Schilling 9a189bc710
Improve search results when only phonebook-matches can we autocompleted
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Joas Schilling 6c1e294edd
Compare and store the login name via the event
Signed-off-by: Joas Schilling <coding@schilljs.com>
3 years ago
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Morris Jobke 9bf76d2bad
Streamline user creation and deletion events
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>
4 years ago
Morris Jobke cb735c671b
Provide correct PHPDoc tags for public namespace
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
4 years ago
Robin Appelman 674db6da88
add event to allow apps to overwrite user quota
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Christoph Wurst 1f7f93a695
Update license headers for Nextcloud 20 (again)
There are still lots of outdated headers, so time for another round of
updates.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Roeland Jago Douma 7b8364e001
Merge pull request #21288 from lmamane/master
Return correct loginname in credentials
4 years ago
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Lionel Elie Mamane ac8b40b8b1
Return correct loginname in credentials,
even when token is invalid or has no password.

Returning the uid as loginname is wrong, and leads to problems when
these differ. E.g. the getapppassword API was creating app token with
the uid as loginname. In a scenario with external authentication (such
as LDAP), these tokens were then invalidated next time their underlying
password was checked, and systematically ceased to function.

Co-authored-by: kesselb <mail@danielkesselberg.de>
for: switch to consistent camelCase

Signed-off-by: Lionel Elie Mamane <lionel@mamane.lu>
4 years ago
Morris Jobke fedf9c69d9
Use matching parameter names form interfaces and implementations
Found by Psalm 3.14.1

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
4 years ago
Morris Jobke 782a2df392
Add PHP doc for events
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
4 years ago
Georg Ehrke 0fad921840
Add user-status app
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
4 years ago
Roeland Jago Douma e0cc95f3aa
Allow user backends to specify a custom logout url
* Allows SSO backends to do a global logout

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
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>
4 years ago
Christoph Wurst 85e369cddb
Fix multiline comments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Arthur Schiwon e394f6a5b5
fixes the return type of BeforeUserLoggedInEvent
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
4 years ago
Christoph Wurst 74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 1b46621cd3
Update license headers for 18
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Christoph Wurst d808f9c053
Add typed events for all user hooks and legacy events
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Christoph Wurst cc80339b39
Add typed create user events
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
5 years ago
Christoph Wurst 535000aac6
Make the post login event public
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Roeland Jago Douma 145eee91fe
Get the proper UID
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>
5 years ago
Roeland Jago Douma df4fa2695e
New user backend interface to check if a user can confirm passwords
On some backends (saml for example) users can't revalidate their
passwords as Nextcloud has no way to do verify it.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Roeland Jago Douma b723a2b8ca
Document parameters
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Roeland Jago Douma 471272d456
Move to ABackend
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Roeland Jago Douma 5aa0d83268
Remove type declarations where not yet possible
Because we don't return consistent things yet :(

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Roeland Jago Douma 140e7b609f
Fix phpdoc
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Roeland Jago Douma 355abbc96d
Add abstract bakend to still be backwards compatible with the old logic
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Roeland Jago Douma 226439a31c
Add interfaces for user backend functionality
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago