aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Group_LDAP.php
Commit message (Collapse)AuthorAgeFilesLines
* chore: apply new CSFixer rulesFerdinand Thiessen2025-07-011-7/+7
| | | | | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> # Conflicts: # apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
* fix(user_ldap): Do not map groups we do not know if they match filterfix/ldap-avoid-false-positive-mappingCôme Chilliet2025-01-271-1/+1
| | | | | | | | When nesting is enabled, filterValidGroups is supposed to check for each groups if it actually exist, because it may not be visible to Nextcloud. So in this codepath we disable automapping of groups. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(OpenAPI): Adjust array syntax to avoid ambiguitiesfix/openapi/array-syntaxprovokateurin2024-11-051-1/+5
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* refactor(apps): Use constructor property promotion when possibleprovokateurin2024-10-211-12/+4
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-6/+6
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-2/+2
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* chore: Add SPDX headerAndy Scherzinger2024-05-301-41/+4
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* fix: Remove obsolete resource typingCôme Chilliet2024-04-091-2/+2
| | | | | | In PHP>=8.1, LDAP and FTP resources are always typed objects Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(LDAP): ensure stored groups are formatted as simple listArthur Schiwon2023-12-201-2/+2
| | | | | | | | | 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>
* enh(LDAP): implement IIsAdmin interfaceArthur Schiwon2023-12-011-1/+17
| | | | | | | | - 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>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-1/+1
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* fix(LDAP): prevent incomplete displaynames…Arthur Schiwon2023-11-071-2/+2
| | | | | | … when reading users from primary groups or gidNumber-based groups Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Merge pull request #40367 from nextcloud/fix/user_ldap-update-groups-on-loginCôme Chilliet2023-10-161-2/+33
|\ | | | | Fire group membership events from LDAP at login
| * Fix LDAP LoginListener by adding new group relationships to caches before ↵Côme Chilliet2023-10-121-2/+33
| | | | | | | | | | | | firing the event Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | fix(LDAP): solve race condition reading groups of disappeared LDAP userArthur Schiwon2023-10-111-4/+41
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | refactor(LDAP): pass IConfig via constructor to Group_LDAPArthur Schiwon2023-10-101-7/+5
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | fix(ldap): store last known user groupsArthur Schiwon2023-10-091-2/+23
|/ | | | | | - for LDAP user life cycle management Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Add batch methods in user backendsCarl Schwan2023-09-051-2/+4
| | | | | | This allows for faster group search with significantly less DB traffic Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add check-group commandCôme Chilliet2023-08-101-7/+26
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Clear up return typesCôme Chilliet2023-04-271-3/+8
| | | | | | usersInGroup index by int for BC, searchInGroup index by uid (string). Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Let OC\Group\Group handle the fallback and remove default implementation ↵Côme Chilliet2023-04-271-11/+2
| | | | | | from ABackend Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Optimize retrieving display name when searching for users in a groupCarl Schwan2023-04-271-4/+13
| | | | | | | | | 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>
* Cache display name even if it was not filledCôme Chilliet2022-11-171-3/+4
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix psalmCarl Schwan2022-10-201-1/+4
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Check if cache is present with issetCarl Schwan2022-10-201-1/+1
| | | | | | Otherwise we get false for empty array Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Bring back small fixes by CarlCôme Chilliet2022-10-201-8/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix LDAP recursive nested group supportCôme Chilliet2022-10-201-4/+7
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Revert Carl changes on apps/user_ldap/lib/Group_LDAP.phpCarl Schwan2022-10-201-27/+12
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Fix user_ldap testsCarl Schwan2022-10-201-9/+9
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add back runtime cache for intermediate ldap read resultsCarl Schwan2022-10-201-2/+10
| | | | | | This is a small optimization that save a few LDAP queries Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Only cache base inGroup searchCarl Schwan2022-10-201-8/+15
| | | | | | | And not intermediate search for nested groups, this is causing issues othewise with nested groups Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add missing copyright author in Group_LDAPCôme Chilliet2022-10-201-0/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Removed unused use declarationCôme Chilliet2022-10-201-1/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix types in docblocksCôme Chilliet2022-10-201-0/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Refactor group membership listing for nested groupsCôme Chilliet2022-10-201-147/+67
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Small optimisation of _groupMembersCôme Chilliet2022-10-201-2/+7
| | | | | | | This will not change the result as users are check to be existing afterwards but avoids this check when we know it’s a group. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Refactor _groupMembers to correctly use cache on intermediate resultsCôme Chilliet2022-10-201-35/+28
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix merging list with nullCarl Schwan2022-10-201-1/+2
| | | | | | | | This fixes some cases observed with the debugger where we end up merging a non empty list with null. The result is then null and the looping over the items would then end. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Unify a bit the types of the fetcherCarl Schwan2022-10-201-16/+17
| | | | | | | Now it will only accept a string as parameter instead of either a string (DN) or a array (complete record). Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add more type hintingCarl Schwan2022-10-201-31/+43
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Cache intermediatesArthur Schiwon2022-10-201-1/+7
| | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de> Co-authored-by: Carl Schwan <carl@carlschwan.eu>
* Refactor code to split common loopArthur Schiwon2022-10-201-37/+15
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Make it possible to return nested records whem walking over groupsArthur Schiwon2022-10-201-4/+43
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Fix typos in apps/ subdirectoryluz paz2022-09-051-1/+1
| | | | | | | Found via `codespell -q 3 -S l10n,./apps/files_external/3rdparty -L adn,ba,boxs,keypair,jus,optionel,ressource,tabel ./apps/` Signed-off-by: luz paz <luzpaz@github.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
* 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>
* Add stricter psalm type for CappedMemoryCacheCarl Schwan2022-05-121-6/+6
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add ldap:reset-group command to unmap groups from LDAPCôme Chilliet2022-04-011-6/+21
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix unit testsCôme Chilliet2022-03-031-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Remove redundant is_array checkCôme Chilliet2022-03-031-11/+9
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #29329 from nextcloud/fix/noid/groups-unwarranted-membersJohn Molakvoæ2021-12-201-2/+14
|\