1311 Commits

Author SHA1 Message Date
Côme Chilliet
8caeb11991 fix(user_ldap): Fix crash in some code path when a DN is longer that 64
UserConfig throws in this case.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-02-04 23:22:28 +01:00
Côme Chilliet
7c88d840ed fix: Use strict array comparisons in user_ldap
Otherwise there are issues with string values looking like numbers.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-01-18 18:45:07 +01:00
Marcel Müller
9bdab70598 fix: Make User_Proxy IGetDisplayNameBackend complient
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
2026-01-16 14:57:21 +01:00
Arthur Schiwon
7a7da7ddde fix(LDAP): drop hard base checks for now
The migration path is hard and unexpected. We can follow-up with a soft
setup check instead for a while, but needs to be discussed.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2025-10-30 13:57:12 +00:00
Arthur Schiwon
88c94744f2 refactor(LDAP): switch from prepares statement to query builder
- has the advantage that queries will be reported in the query.log when
  configured

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2025-10-17 10:09:03 +00:00
Arthur Schiwon
2a5b0a42f5 feat: locally cache frequently requested LDAP mapping data
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2025-10-17 10:09:03 +00:00
Arthur Schiwon
6ba452b426 fix(LDAP): properly disable are require TLS certificate verification
- the old approach lead connection issues, as ldap_set_option was called
  too late. Specifically it needs to be called before ldap_connect and set
  globally!
- The old approach also connected it to the ldapTLS configuration, which
  has a misleading naming. It indicates StartTLS usage only, not plain TLS
  connections.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2025-10-14 07:42:25 +00:00
Côme Chilliet
94620e2310 fix(ldap): Fix copying and creating LDAP configuration
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-10-06 16:22:27 +00:00
Joas Schilling
1d43f6b4a9 Merge pull request #53714 from Mark-PAS/master
Only attempt $result array access if array not empty.
2025-07-14 11:25:27 +02:00
Ferdinand Thiessen
5981b7eb51 chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +02:00
Mark
b04760af6e Only attempt $result array access if array not empty.
Signed-off-by: Mark <mark@perkinsadministrationservices.com.au>
2025-07-01 07:44:20 +09:30
Côme Chilliet
f48e5aa1f3 fix(user_ldap): Switch to OCP\IAppConfig and fix Helper constructor calls
Using OCP\AppFramework\Services\IAppConfig is not possible because the
 Helper is queried from places outside of the application DI container
(ajax pages, tests, other applications through ILDAPProviderFactory…)

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-06-10 16:08:52 +02:00
Côme Chilliet
bc7309ca1c fix(user_ldap): Store the list of used configuration prefixed in appconfig
This avoids getting all keys from appconfig, which was triggering
 loading of lazy configuration on all requests.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-06-10 16:08:45 +02:00
Côme Chilliet
6da579fb1d fix(user_ldap): Harmonize parameter obfuscation and serialization accross logging methods
Debug log, profiler and ldap debug log had a different logic for
 sanitizing of parameters, aligning them.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-06-02 11:47:56 +02:00
provokateurin
78a175fc74 refactor: Apply rector refactorings
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-05-14 15:29:02 +02:00
Ferdinand Thiessen
1ae3fa4003 chore: replace leagcy OC_Helper calls with OCP\Util
- Replace legacy calls with OCP\Util
- Add missing deprecation notices
- Inline implementation in OCP\Util and call it from OC_Helper

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-14 10:18:04 +02:00
Arthur Schiwon
1eb9000b0d fix(LDAP): inlcude ldapExpertUsernameAttr in general attribute list
fixes corner cases in which an LDAP record might be loaded and used,
where the user is still not mapped - and then this information is
missing though expected.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2025-04-17 17:00:31 +02:00
Côme Chilliet
0cf4f3cc71 fix: Replace all usages of OC_User backend method calls by IUserManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-04-10 11:29:21 +02:00
Ferdinand Thiessen
5211448940 fix(l10n): put placeholder like string into variable
Otherwise this is wrongly handled by our translation community.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-04-07 18:39:40 +02:00
Côme Chilliet
f033ef7c18 fix: Migrate all uses of OCP\Template to OCP\Template\ITemplateManager
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-03-06 15:49:25 +01:00
Arthur Schiwon
4fe518a57b Merge pull request #51096 from nextcloud/fix/noid/ldap-setopt-for-disabling-certcheck
fix(LDAP): use ldap_set_option over putenv to disable cert check
2025-03-06 13:00:08 +01:00
Côme Chilliet
71759bf856 feat: Add bases and gidNumber attribute to ldap:test-user-settings output
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-03-04 10:05:50 +01:00
Arthur Schiwon
939a8d5ea5 fix(LDAP): use ldap_set_option over putenv to disable cert check
the putenv option was not working reliable anymore anyway

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2025-03-03 12:53:24 +01:00
Daniel Kesselberg
7facae6b83 fix: remove caching in fetchListOfGroups
When using nested groups without a memberof overlay, then fetchListOfGroups is called from getGroupsByMember without applying the group filter.

In some setups, the "unfiltered" result is then written back to the group mapping table. That might cause random "An administrator removed you from group" activities.

I was unable to replicate it locally, but we got the feedback that the random activities stopped with the patch applied.

Ref: https://github.com/nextcloud/server/issues/42195

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2025-02-27 12:02:44 +01:00
Joas Schilling
095ab4419e fix(l10n): Improve english source strings
- No leading/trailing whitespace
- Use asci single quote

Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-02-26 09:54:32 +01:00
Côme Chilliet
36d756ab0f fix(user_ldap): Check that all user and group bases are in the global one
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-25 22:18:18 +01:00
Côme Chilliet
0d35a3df02 fix(user_ldap): Add missing use in ajax endpoint and fix L10N injection
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-25 22:18:18 +01:00
Côme Chilliet
7629d4df17 feat(user_ldap): Improve error detail when saving an incorrect configuration
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-25 22:18:18 +01:00
Côme Chilliet
64863c9d46 chore: Apply new rector configuration to apps folder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-02-13 11:46:42 +01:00
Côme Chilliet
7fa117dd0f feat(user_ldap): Add a --clearcache option to ldap:test-user-settings
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-30 15:07:15 +01:00
Côme Chilliet
e094602311 fix(user_ldap): Remove redundant if check
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-30 13:47:09 +01:00
Côme Chilliet
1098ef3b69 feat(user_ldap): Add command test-user-settings to test LDAP user settings
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-30 11:55:43 +01:00
Côme Chilliet
e55806b546 feat(user_ldap): upstream common code into Proxy class and add public getters for backends
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-30 11:49:58 +01:00
Côme Chilliet
de77415c70 fix(user_ldap): Do not map groups we do not know if they match filter
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>
2025-01-27 14:51:51 +01:00
Arthur Schiwon
0815aa0591 fix(LDAP): also log why the connection to main server failed
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2025-01-24 18:55:10 +01:00
Arthur Schiwon
2de855f0bc Merge pull request #50162 from nextcloud/fix/improve-ldap-avatar-handling
Improve ldap avatar handling
2025-01-16 21:43:29 +01:00
Côme Chilliet
e187e4e87f feat(updatenotification): Add a limit to user count from LDAP so save performances
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-14 12:26:24 +01:00
Côme Chilliet
12d1d1d389 fix(user_ldap): Remove now unused class FilesystemHelper
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-13 17:12:19 +01:00
Côme Chilliet
e75dd1fc92 fix(user_ldap): Strong type User class and fix most type issues
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-13 17:12:19 +01:00
Côme Chilliet
40920ddb77 fix(user_ldap): Always update avatar from LDAP when we have the data
Should be at login, in sync job, and when running ldap:check-user --update

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-13 16:23:26 +01:00
Côme Chilliet
d2f118f147 chore(user_ldap): Improve typing in user_ldap User class
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-13 16:01:39 +01:00
Côme Chilliet
c0cb8ec7d4 chore(user_ldap): Rename avatar setting method to a more suited name
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-01-13 15:54:48 +01:00
Thatoo
486f0eda71 fix(user_ldap): retrieve from LDAP first "email shaped" value instead of first value
Signed-off-by: Thatoo <Thatoo@users.noreply.github.com>
2024-11-20 16:55:44 +01:00
provokateurin
77114fb327 fix(OpenAPI): Adjust array syntax to avoid ambiguities
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-11-05 09:58:11 +01:00
provokateurin
e8426996f5 fix(psalm): Fix some newly detected issues
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-21 12:37:59 +02:00
provokateurin
381077028a refactor(apps): Use constructor property promotion when possible
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-21 12:37:59 +02:00
Git'Fellow
a1681b0756 chore(db): Apply query prepared statements
Fix: psalm

fix: bad file

fix: bug

chore: add batch

chore: add batch

chore: add batch

fix: psalm
2024-10-17 20:30:47 +02:00
Git'Fellow
c254855222 chore(db): Correctly apply query types
fix: psalm

fix: error

fix: add batch

fix: fatal error

fix: add batch

chore: add batch

chore: add batch

fix: psalm

fix: typo

fix: psalm

fix: return bool

fix: revert Manager
2024-10-17 09:21:07 +02:00
Côme Chilliet
1580c8612b chore(apps): Apply new rector configuration to autouse classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-10-15 10:40:25 +02:00
provokateurin
51d9d63a01 chore: Use more gender neutral language
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-14 13:59:24 +02:00