Commit Graph

1297 Commits (42f45030ff282504d7c6d6321e46ce118d5e4087)

Author SHA1 Message Date
Côme Chilliet 303e2febc7
Merge pull request #43387 from nextcloud/fix/migrate-away-from-ilogger-in-jobs 2024-02-08 18:27:44 +07:00
Louis Chemineau 898df41de9
Revert "Merge branch 'master' of github.com:nextcloud/server"
This reverts commit d9d60238c7, reversing
changes made to ba3fdb0cdc.
2024-02-08 15:31:19 +07:00
Côme Chilliet 166773879b fix!: Migrate jobs away from deprecated interfaces
BREAKING CHANGE: Removed ILogFactory::getCustomLogger deprecated method

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-08 10:28:29 +07:00
Faraz Samapoor e6a4ebcc92 Update apps/user_ldap/lib/Command/Search.php
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2024-02-06 10:02:11 +07:00
Faraz Samapoor f03781b509 Refactors user_ldap app commands.
To improve code readability.

Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2024-02-06 10:02:11 +07:00
Côme Chilliet b2e9e0fa0d chore: Replace OC::$server->getL10N by OCP\Util::getL10N in lib and some apps
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-05 11:16:04 +07:00
Ferdinand Thiessen b8fbd7721d
fix(user_ldap): Ensure host is a string when checking if `ldapi`
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-01-26 14:53:32 +07:00
provokateurin 88f7d5bf84
chore(deps): Update openapi-extractor
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-01-18 16:00:18 +07:00
Côme Chilliet 658b20aef5
Fix crash of login in case of duplicated group membership
If several LDAP configurations return the same group id for a user it
 should still only appear once in the return of getUserGroups

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-15 09:39:59 +07:00
Côme Chilliet 6d0f0fc01b Fix upgrade of user_ldap when oc_group_members contains duplicated uids
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-04 11:51:33 +07:00
Arthur Schiwon ee096f8629
fix(LDAP): ensure stored groups are formatted as simple list
With array_unique it is possible that the keys are not in sequential order
but have gaps. json_encode then would store them as associative array,
which later on json_decode would result in a stdClass by default. This is
unexpected and would also contradict the return type hint.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-12-20 17:05:58 +07:00
Pytal 294330454b
Merge pull request #40169 from nextcloud/enh/load-disabled-users-directly
enh(settings): Load from disabled users endpoint
2023-12-01 08:42:04 +07:00
Arthur Schiwon 37237dc183 feat(LDAP): warn about demoting a group while promoting another
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-12-01 12:48:24 +07:00
Arthur Schiwon 18e6c9f5bc enh(LDAP): add occ command to promote an LDAP group to admin
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-12-01 12:48:24 +07:00
Arthur Schiwon d6b356c63b enh(LDAP): implement IIsAdmin interface
- add configuration to specify one LDAP group acting as admin group (CLI)
- implement `isAdmin()` method, basically relying on inGroup against the
  configured group

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-12-01 12:48:24 +07:00
Côme Chilliet adc43eae9b Invert parameter order in getDisabledUserList to be consistent
This matches what was done in the calls and so fixes getting disabled
 user list when there are several backends returning disabled users.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-11-30 17:15:12 +07:00
Joas Schilling aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +07:00
Arthur Schiwon d978050666
fix(LDAP): prevent incomplete displaynames…
… when reading users from primary groups or gidNumber-based groups

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-11-07 21:02:31 +07:00
Côme Chilliet 6b7d4b67d1
Improve setup checks naming and improve database version check
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-24 11:40:03 +07:00
Côme Chilliet 2e4d1549a4
Change SetupResult API to named constructors
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-19 11:44:03 +07:00
Côme Chilliet b41b9cf4c0
Small cleanups in SetupCheck classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-19 11:43:59 +07:00
Côme Chilliet 0890012e72
Fix SetupChecks/LdapInvalidUuids.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-19 11:43:58 +07:00
Carl Schwan c71e47f5c3
Progress
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2023-10-19 11:43:58 +07:00
Côme Chilliet 8212feefb9
Merge pull request #40367 from nextcloud/fix/user_ldap-update-groups-on-login
Fire group membership events from LDAP at login
2023-10-16 10:01:55 +07:00
Côme Chilliet 05efbf11d9
Fix LDAP LoginListener by adding new group relationships to caches before firing the event
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-12 10:13:43 +07:00
Côme Chilliet 800b1b7031
Fire group events at login for LDAP groups
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-12 10:13:43 +07:00
Côme Chilliet 6e38cb197a
Add logging to be able to debug FirstLoginListener
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-12 10:13:42 +07:00
Côme Chilliet 4f2048851c
Move event listener registration to register()
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-12 10:13:42 +07:00
Côme Chilliet 2e52e39aff
Use a standard array for the stateful cache
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-12 10:13:42 +07:00
Côme Chilliet 474b5e1a05
Add FirstLoginListener to accept shares upon first ldap user login
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-10-12 10:13:41 +07:00
Arthur Schiwon cce8d0a7a5
fix(LDAP): solve race condition reading groups of disappeared LDAP user
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-10-11 15:35:10 +07:00
Arthur Schiwon c1480aade4
refactor(LDAP): pass IConfig via constructor to Group_LDAP
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-10-10 11:18:57 +07:00
Arthur Schiwon cb3faad5b5
fix(ldap): store last known user groups
- for LDAP user life cycle management

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-10-09 19:46:27 +07:00
Côme Chilliet 9ebcd287ef
Merge pull request #37201 from AaronDewes/fix/ldap-filter-generation
Fix: Escape group names for LDAP
2023-10-02 09:49:22 +07:00
Marcel Klehr 7f5b61c66d
Update apps/user_ldap/lib/User/User.php
Co-authored-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-09-29 13:48:06 +07:00
Marcel Klehr 66f6e94d7d LDAP: Increase profile picture limit to 512
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
2023-09-29 12:47:48 +07:00
Hamid Dehnavi d64bbc8bd3 Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-09-28 12:18:41 +07:00
jld3103 c2d45cb172
Add single status code descriptions for OpenAPI
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-09-27 08:05:21 +07:00
Aaron Dewes aefa366495
Merge branch 'master' into fix/ldap-filter-generation 2023-09-20 15:38:52 +07:00
Côme Chilliet 7a59d2ec07
Remove deprectated ILogger uses from user_ldap application
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-19 15:22:45 +07:00
Julius Härtl 97dd09c434
Merge pull request #39128 from nextcloud/fix/35319/ldap-missing-avatar 2023-09-11 19:43:18 +07:00
Côme Chilliet 2c8b415c55
Move new methods to a new interface in OCP
This avoids breaking compatibility for group backends not based on
 ABackend abstract class.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-05 16:56:48 +07:00
Côme Chilliet a5fa1e7715
Fix psalm errors about groupExists return type
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-05 16:56:48 +07:00
Carl Schwan 3270b7f12e
Add batch methods in user backends
This allows for faster group search with significantly less DB traffic

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2023-09-05 16:56:47 +07:00
Anna Larch 5d5134e615 Do not log passwords in debug mode
Signed-off-by: Anna Larch <anna@nextcloud.com>
2023-08-24 10:39:27 +07:00
Aaron Dewes 16908999ed Simplify escapeFilterPart
Signed-off-by: Aaron Dewes <aaron.dewes@protonmail.com>
2023-08-13 15:43:04 +07:00
Aaron Dewes 13d9494af3 Escape some more values
Signed-off-by: Aaron Dewes <aaron.dewes@protonmail.com>
2023-08-13 15:43:04 +07:00
AaronDewes c42d9d439a Fix: Escape group names for LDAP
Groups may contain special characters (Like "(" or ")") that should be escaped to ensure geenrted queries are correct.

Signed-off-by: AaronDewes <aaron.dewes@protonmail.com>
2023-08-13 15:43:04 +07:00
Côme Chilliet a0808111b4
Add unique index for user_ldap group memberships
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:37 +07:00
Côme Chilliet b8a0954f55
Fix check-group --update for deleted groups
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:37 +07:00
Côme Chilliet 5425f7d3bd
Use BIGINT for new table id field
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:36 +07:00
Côme Chilliet 7732de75ee
Removed GroupCreatedEvent/GroupDeletedEvent from UpdateGroupsService
This should be handled when mapping groups, not when registering their
 members. An empty group may still exist.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:36 +07:00
Côme Chilliet ad1e487f67
Dispatch UserRemovedEvents for removed groups
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:35 +07:00
Côme Chilliet c33c40f677
[user_ldap] Small perf improvements suggestion from review
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:35 +07:00
Côme Chilliet 1026b2131c
Fix check-group command for new groups
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:34 +07:00
Côme Chilliet 42448c0d78
Fix getKnownGroups return value
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:34 +07:00
Côme Chilliet 7a14aa748e
Add output to check-group --update command
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:34 +07:00
Côme Chilliet ce5a4e5b66
Always empty cache before updating a group
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:34 +07:00
Côme Chilliet 1b102ca9b3
Fix errors in UpdateGroupsService.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:33 +07:00
Côme Chilliet ec13f22ae3
Add missing primary key for ldap_group_membership
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:33 +07:00
Côme Chilliet f9ed48eab9
Add check-group command
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:33 +07:00
Côme Chilliet 2c19aac9e1
Move UpdateGroups methods to a service
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:33 +07:00
Côme Chilliet 34fa4138fb
Add group events to UpdateGroups
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:32 +07:00
Côme Chilliet d8142b6a5a
Refactor user_ldap group membership to use flat DB
Move away from serialized arrays. Also use a QBMapper class for the new table.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:25 +07:00
Côme Chilliet b155f87a84
Merge pull request #39058 from nextcloud/fix/fix-ldap-filters-for-empty-search
Avoid adding (attribute=) part to filter which will confuse LDAP servers
2023-08-08 09:21:20 +07:00
jld3103 61a13bed4d
user_ldap: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-07-31 12:17:42 +07:00
Joas Schilling 77bc6c32d8
fix(dispatcher): Move remaining simple cases in apps/ folder to IEventDispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-25 11:19:26 +07:00
Arthur Schiwon 4054a7ddc8
fix(LDAP): add return type hint and description
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-07-07 10:46:00 +07:00
Arthur Schiwon 92a082d823
fix(ldap): avatar is not being fetched
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-07-05 17:13:43 +07:00
Côme Chilliet b2f01b72fe
Merge pull request #34443 from nextcloud/feat/add-enabled-user-backend
Add IProvideEnabledStateBackend interface
2023-07-03 10:19:32 +07:00
Côme Chilliet 189ccc2d72
Add method to list disabled users to IProvideEnabledStateBackend
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-06-29 16:15:12 +07:00
Côme Chilliet 4a0351878c
Avoid adding (attribute=) part to filter which will confuse LDAP servers
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-06-29 10:42:59 +07:00
Arthur Schiwon 2e81a1d839
Merge pull request #38457 from nextcloud/fix/improve-ldap-offset-search-perf
Use default page size for jumping to desired offset
2023-06-22 21:46:03 +07:00
Côme Chilliet b980722e89
Fix paged search when offset is not a multiple of default page size
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-06-20 16:13:59 +07:00
Côme Chilliet 1603cdc8d2
Fix since annotations and add boolean return type for setUserEnabled
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-06-20 15:10:39 +07:00
Faraz Samapoor b0938b9083 Refactors "strpos" calls in /apps/user_ldap to improve code readability.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2023-06-02 15:26:55 +07:00
Côme Chilliet add59d2309
Use DI for DeletedUsersIndex and fix tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-25 12:18:28 +07:00
Côme Chilliet b186cffdbe
Use default page size for jumping to desired offset
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-25 11:31:29 +07:00
Côme Chilliet 50ccfb4f5b
[user_ldap] Add per-connection setting for marking remnants as disabled
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-23 16:03:17 +07:00
Côme Chilliet 684a81e4bd
Use the new IProvideEnabledStateBackend interface in user_ldap
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-23 11:25:22 +07:00
Côme Chilliet c995428431
Merge pull request #37903 from nextcloud/fix/user_ldap-fix-multiple-ldap-support
Fix multiple LDAP configuration support by fixing AccessFactory
2023-05-02 17:11:01 +07:00
Côme Chilliet b6c17c6ce7
Clear up return types
usersInGroup index by int for BC, searchInGroup index by uid (string).

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-27 12:00:45 +07:00
Côme Chilliet 6385a5af36
Let OC\Group\Group handle the fallback and remove default implementation from ABackend
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-27 12:00:43 +07:00
Carl Schwan 35dc223500
Optimize retrieving display name when searching for users in a group
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>
2023-04-27 11:57:45 +07:00
Côme Chilliet 967955358c
Add comment about Manager instance not being shared
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-27 11:21:53 +07:00
Daniel 2abefff289
Merge pull request #36784 from nextcloud/fix/user_ldap-update-groups-fail-get
Properly test and log when a group is not found
2023-04-24 16:26:30 +07:00
Côme Chilliet 429db14a00
Fix multiple LDAP configuration support by fixing AccessFactory
It must not reuse the same OCA\User_LDAP\User\Manager instance for
 several Access instances.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-24 16:03:40 +07:00
Marc Hefter 621c6c3c56
code styling
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marc Hefter <marchefter@march42.net>
2023-04-24 10:21:45 +07:00
Marc Hefter aa210365ec
Update apps/user_ldap/lib/User/User.php
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marc Hefter <marchefter@march42.net>
2023-04-24 10:14:17 +07:00
Marc Hefter e83520617d
removed profile data from LDAP will get removed
If attribute mapping is configured and no value present in LDAP, the
according profile field is emptied. Removing an attribute e.g. phone
from LDAP will cause the phone number being removed from profile.

Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-21 10:35:44 +07:00
Simon L 93966e99c1
Merge pull request #36565 from march42/feature/ldap_update_profile
[user_ldap] Update profile from LDAP fields
2023-04-20 11:23:24 +07:00
Marc Hefter 64914593a0
optimized handling of user profile data change
Check profile data checksum before updating user profile, to ensure
data has changed. Write checksum to user settings and cache.

Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-14 11:08:46 +07:00
Julien Veyssier f3cd559c54 perform exact Ldap search as well to make sure it works for attributes without a substr matching rule
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2023-04-13 19:59:17 +07:00
Marc Hefter eec5e702da
error handling in update profile from LDAP
added error message on InvalidArgumentException

Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-11 16:40:00 +07:00
Marc Hefter ebb0c53f9e
trying to make github-code-scanning bot happy
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:31 +07:00
Marc Hefter 72d0a3f26e
added simple data conversion for LDAP attributes
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:31 +07:00
Marc Hefter 1e7bc93ec8
handling, formatting of postalAddress attribute syntax
replace '$' with ', ' delimiter for address property
reformatted some code to 80 column
early check and return, if wasRefreshed('profile')
removed FIXMEs after digging and double checking

Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:30 +07:00
Marc Hefter 5ea46d81bb
nice up the code handling AccountManager
merging defaultScopes from DEFAULT_SCOPES and account_manager.default_property_scope
removing unneccessary profileScope setting (using config.php instead)
honoring admin choice 'profile.enabled'=>false in config.php
moved checking for empty array to updateProfile function
corrected some typos and cleaned some comments

Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:30 +07:00
Marc Hefter dd2bd6a925
refined code, to be independend from OCP\IUser
rework updateProfile in user_ldap/lib/User/User.php
some cleanup at processAttributes in user_ldap/lib/User/User.php
rearranged Fediverse attribute, to match profile layout

Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:29 +07:00
Marc Hefter c6408587ed
fixing Psalm messages
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:28 +07:00
Marc Hefter f812b87576
handling updateProfile with array of values
using an array to buffer profile updates, like suggested by @come-nc
clean some code and remove unneccessary redundancy
added the Fediverse profile property

Co-Authored-By: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:28 +07:00
Marc Hefter 5c4a05cfd6
CleanUp: removed redundant storing profile attributes in user settings
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:27 +07:00
Marc Hefter 3020290751
CleanUp: removed redundant condition if block
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:27 +07:00
Marc Hefter 2f76b7a3d5
CleanUp: tidy checking for empty profileScope
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:26 +07:00
Marc Hefter 44065c0fea
Fix: Parameter $scope has no provided type
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Marc Hefter <marchefter@march42.net>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:25 +07:00
Marc Hefter 26aa1c3580
CleanUp: remove unneeded UNSET, to unclutter code
Signed-off-by: march42 <marchefter@gmail.com>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:25 +07:00
Marc Hefter 240c57b94b
cleanup: removed unnecessary imports of IAccountManager, AccountManager, IDBConnection
Signed-off-by: Marc Hefter <marchefter@march42.net>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:24 +07:00
Marc Hefter b72fbd58f6
fixed error: Array to string conversion at user_ldap/lib/User/User.php#639
Signed-off-by: Marc Hefter <marchefter@march42.net>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:23 +07:00
Marc Hefter c7623c7869
bugfix: changed forgotten userName, to getUsername
Signed-off-by: Marc Hefter <marchefter@march42.net>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:22 +07:00
Marc Hefter eee0275dc5
added user profile scope setting
Signed-off-by: Marc Hefter <marchefter@march42.net>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:22 +07:00
Marc Hefter 2315c17726
feature addition: [user_ldap] update user profile from LDAP
Signed-off-by: Marc Hefter <marchefter@march42.net>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:21 +07:00
Marc Hefter 7fa3c674de
feature addition: [user_ldap] update user profile from LDAP; WIP; fixing some uggly copy-and-paste errors; testing functionality; preparing and editing the documentation
Signed-off-by: Marc Hefter <marchefter@march42.net>
Signed-off-by: Marc Hefter <marchefter@gmail.com>
2023-04-06 08:20:20 +07:00
Marc Hefter 404d26aa4a
feature addition: [user_ldap] update user profile from LDAP; WIP work-in-progress; TODO update profile
Signed-off-by: Marc Hefter <marchefter@march42.net>
2023-04-06 08:19:39 +07:00
Arthur Schiwon bd0f374cfd
Merge pull request #37575 from nextcloud/fix/user_ldap-log-suffix-names
Log a warning when a user or group is mapped with a suffix
2023-04-05 10:28:23 +07:00
jld3103 d9f8522003
Fix types for reading and writing config values
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-04-05 09:08:56 +07:00
Côme Chilliet 51705da7a4
Log a warning when a user or group is mapped with a suffix
Most of the time, this is the result of a misconfiguration by the admin
 and is not what is expected.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-04-04 14:08:24 +07:00
Arthur Schiwon 17afaa488f
fix undefined method getExtStorageHome()
- adds a type check
- defines missing method in OfflineUser

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-03-22 13:54:27 +07:00
Arthur Schiwon 8f59ff880f
Merge pull request #37006 from nextcloud/ldap-unmark-dh
also unmark deleted ldap user when checking the ldap entry
2023-03-20 16:15:03 +07:00
Côme Chilliet d82d6df646
Do not send a pagination control with size = 0 if cookie is empty
It only makes sense to send a pagination control with size 0 with a
 cookie to abandon a paged search.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-03-13 16:05:41 +07:00
Robin Appelman 3a9597fd1b
also unmark deleted ldap user when checking the ldap entry
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-03-02 16:22:17 +07:00
Côme Chilliet 0186194ae9
Properly test and log when a group is not found
Avoid an error about passing null instead of IGroup to the event
 constructor, instead skip the failed group and log the problem.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-20 17:34:53 +07:00
Côme Chilliet 3c0b1bdc30
Remove redundant cast to string in user_ldap
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-02 15:11:13 +07:00
Côme Chilliet a372564850
Fix psalm spotted errors with new requirements
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-02 15:02:28 +07:00
Vincent Petry 13d5426893
Merge pull request #35839 from nextcloud/feat/user_ldap-longer-ttl-for-fallback
Apply a longer TTL of 15min to falling back on backup server
2022-12-20 17:19:56 +07:00
Côme Chilliet f6ff717b56
Merge pull request #34772 from nextcloud/fix/clean-ldap-access-factory-usage
Make sure to use AccessFactory to create Access instances and use DI
2022-12-20 16:48:07 +07:00
Côme Chilliet 1ac2c74830
Apply a longer TTL of 15min to falling back on backup server
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-20 12:01:25 +07:00
Côme Chilliet 6b7ffcd6a8
Fixed backup host logic
Now forcing backup host applies to both main and background.
And background will fallback to backup if not responding.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 14:15:48 +07:00
Côme Chilliet 406750552e
Make code clearer for background host
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 14:15:48 +07:00
Côme Chilliet 4758bdc476
Use a dedicated LDAP host and port for background jobs if configured
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-19 14:15:46 +07:00
Côme Chilliet 75e369d306
Merge pull request #35231 from nextcloud/fix/user_ldap-cache-fetched-list-of-groups
Cache the fetched list of groups
2022-12-19 12:34:05 +07:00
Côme Chilliet f7cd7047a2
Merge pull request #24574 from zenlord/ldapi-unix-socket-support
Ldapi unix socket support
2022-12-08 17:25:00 +07:00
Côme Chilliet a0f6a6545b
Use TimedJob from OCP instead of OC
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-12-05 10:13:34 +07:00
blizzz b16c9838c6
Merge pull request #35355 from nextcloud/artonge/feat/ldap_connection_timeout
Allow to set a custom timeout for ldap connections
2022-11-30 14:44:15 +07:00
Côme Chilliet e00740ea38
Merge pull request #35230 from nextcloud/fix/user_ldap-log-backup-switch
Log switching to LDAP backup host because main one is not available
2022-11-24 18:20:36 +07:00
Louis Chemineau a781ae3afb Allow to set a custom timeout for ldap connections
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-11-23 11:37:49 +07:00
Côme Chilliet 90165309e1
Improve a bit codestyle
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-22 16:57:24 +07:00
Côme Chilliet 911967867f
Merge branch 'master' into ldapi-unix-socket-support
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2022-11-22 16:47:42 +07:00
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>
2022-11-21 16:05:17 +07:00
Côme Chilliet 4893501abe
Log as warning instead of info when main LDAP server is unreachable
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-21 10:31:24 +07:00
Côme Chilliet 9e1dd52c99
Cache the fetched list of groups
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-17 15:12:24 +07:00
Côme Chilliet 3e15ea6cd0
Log switching to LDAP backup host because main one is not available
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-17 14:58:44 +07:00
Côme Chilliet 1d00290621
Cache display name even if it was not filled
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-17 14:47:00 +07:00
Arthur Schiwon e6e18b4008
[LDAP] always create instance of own user manager
- it is config specific and cannot be shared
- because the Access instance is bound later, it is not obvious from the
  constructor

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-11-10 10:32:01 +07:00
Vincent Petry a736a2b03b
Merge pull request #34702 from nextcloud/fix/clean-ldap-wizard-typing
Clean up LDAP Wizard typing
2022-11-04 17:29:30 +07:00
Carl Schwan 4344a54a1d
Merge pull request #34691 from nextcloud/profiler/ldap-backtrace
Add backtrace to ldap profiler collector
2022-10-25 17:00:23 +07:00
Côme Chilliet 556e3c84e6
Fix return type for countUsers method
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-25 10:20:09 +07:00
Côme Chilliet 5242a78994
Fix $host var handling to avoid passing null to ldap_connect
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-25 09:59:56 +07:00
Côme Chilliet 4130a4cbd8
Make sure to use AccessFactory to create Access instances and use DI
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-25 09:52:35 +07:00
Côme Chilliet 142f9913a6
Expose mapped user count from LDAP and use that for user limit check
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-24 16:54:41 +07:00
Simon L 47da08fe85
Merge pull request #33945 from nextcloud/fix/noid/fair-use-ldap
LDAP to not register new users when outside of fair use or over limits
2022-10-21 18:53:16 +07:00