Commit graph

167 commits

Author SHA1 Message Date
Côme Chilliet
dfa994ef28
Merge pull request #47865 from nextcloud/admin_audit/enh/move-to-event-listeners-v2
Move admin_audit to proper event listeners v2
2024-09-13 16:21:44 +02:00
Arthur Schiwon
c8fc2e8a67
fix(LDAP): check index before accessing it
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2024-09-12 11:18:18 +02:00
Carl Schwan
986a3d45f8
feat(user_ldap): Introduce user id assigned typed events for LDAP usage
Based on work from https://github.com/nextcloud/server/pull/32019

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2024-09-10 14:06:11 +02:00
Côme Chilliet
36479df042
chore: composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-08-27 13:03:25 +02:00
Côme Chilliet
fffba1c6af
fix(ldap): Fix user_ldap attribute casing to fix tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-08-27 10:06:45 +02:00
Côme Chilliet
d2bc636a79
fix(user_ldap): Correctly cache that user exists to avoid a request on mapping new user
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-08-27 10:06:43 +02:00
Côme Chilliet
4fb1d2f3e5
fix(user_ldap): Avoid extra LDAP request when mapping a user for the first time
Avoids using several LDAP searches to get UUID, display name and
 internal name, now gets all attributes at the same time.
Also avoids extra request to build an unused user object in userExists.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-08-27 10:05:12 +02:00
Daniel Kesselberg
af6de04e9e
style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
Ferdinand Thiessen
14778811b4
refactor: Use IAppConfig for setting cron type
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-06-28 18:00:39 +02:00
Andy Scherzinger
8d8891c5bc
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-30 15:49:33 +02:00
Côme Chilliet
3ad4bbb096
Merge pull request #44658 from nextcloud/fix/migrate-away-from-resource-type
fix: Remove obsolete resource typing
2024-04-16 17:13:07 +02:00
Côme Chilliet
6d7ff2e85a
fix: Fix typing issues related to resource migration
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-09 10:48:27 +02:00
Côme Chilliet
0f348516d2 fix: Remove obsolete resource typing
In PHP>=8.1, LDAP and FTP resources are always typed objects

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-09 10:01:47 +02:00
Arthur Schiwon
55d3a2af9e
docs(LDAP): add info on stored DN form
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2024-04-05 16:47:55 +02:00
Côme Chilliet
ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +02:00
Côme Chilliet
2874dff773
fix(user_ldap): Early failure for empty password login attempt
This avoids user_ldap logging about an invalid configuration with an
 empty password when the empty password actually comes from a login
 attempt.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-03-06 16:47:16 +01: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 +01: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 +01: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 +02: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 +03:30
Aaron Dewes
16908999ed Simplify escapeFilterPart
Signed-off-by: Aaron Dewes <aaron.dewes@protonmail.com>
2023-08-13 15:43:04 +02: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 +02: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 +02: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 +02: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 +03:30
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 +02: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 +02: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 +00: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 +02: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 +01: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 +01:00
Côme Chilliet
00c4c3d723
Merge pull request #30223 from nextcloud/nested_ldap_groups
Nested ldap groups
2022-10-20 15:03:37 +02:00
Côme Chilliet
50a52ac2a5
Pass paging information directly to search and get rid of adapter
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:56:16 +02:00
Côme Chilliet
14804d9677
Renamed ambiguous $limit parameter to pageSize
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:56:16 +02:00
Côme Chilliet
d10dfa84db
Unfold call to ldap_parse_result. Handle cookie outside of adapter.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:56:15 +02:00
Côme Chilliet
3c9b1c5296
Do not init a paged search for read operations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:56:15 +02:00
Côme Chilliet
d790d45567
Remove dead code in paged result handling
There is only one paged result API now that PHP 7.2 is long dead.
Starting by removing empty function calls.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:56:14 +02:00
Arthur Schiwon
5647093319 Cache intermediates
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Co-authored-by: Carl Schwan <carl@carlschwan.eu>
2022-10-20 12:08:34 +02:00
luz paz
9d26671f05 Fix typos in apps/ subdirectory
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>
2022-09-05 12:59:54 +00:00
Côme Chilliet
df29acb343
Set $limit as int as well in Access::count private method
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-08 10:21:54 +01:00
Côme Chilliet
dab5ea958a
Fix unit tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-03 16:35:06 +01:00
Côme Chilliet
fb63484ced
Improve typing in user_ldap to detect problems early
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-03 11:12:09 +01:00
Côme Chilliet
8349530fb4
Fix executeRead when connection is reset because of a timeout
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-03 10:24:07 +01:00
Côme Chilliet
44680b5c3b
Make it explicit that a DN can be used for ldap:check-user
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-17 10:00:25 +01:00
Vincent Petry
cd1bf94181
Merge pull request #31073 from nextcloud/fix/user_ldap-fix-access-typing
Improve typing in OCA\User_LDAP\Access and reduce psalm errors
2022-02-10 17:53:58 +01:00
Côme Chilliet
9f2db6e65d
Fix ldap:update-uuid
Generators cannot be iterated with while or returned by an other
 generator, using foreach instead.
And a few other problems.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-10 10:15:00 +01:00
Côme Chilliet
77add404b1
Remove mixed type not available in PHP 7.4
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-08 14:32:23 +01:00
Côme Chilliet
2a0b2250d2
Improve typing in OCA\User_LDAP\Access and reduce psalm errors
This should avoid some PHP warning using PHP 8.1
 and help detecting type trouble early in the future.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-02-08 14:21:16 +01:00
Carl Schwan
aeecb72e96
Fix a few psalm issues and moved back to psalm/phar 4.18
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-12 20:03:06 +01:00
Côme Chilliet
f3dcbfe146
Fix PHP 8.1 support for user_ldap application
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-16 09:43:30 +01:00