Commit Graph

157 Commits (5c49a54801b73afd4ed5ae688206637efd70ce2b)

Author SHA1 Message Date
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 +07: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 +07: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 +07: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 +07: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 +07: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 +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
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
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
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
Aaron Dewes 16908999ed Simplify escapeFilterPart
Signed-off-by: Aaron Dewes <aaron.dewes@protonmail.com>
2023-08-13 15:43:04 +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
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 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 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
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
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
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 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 00c4c3d723
Merge pull request #30223 from nextcloud/nested_ldap_groups
Nested ldap groups
2022-10-20 15:03:37 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Côme Chilliet dab5ea958a
Fix unit tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-03 16:35:06 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Côme Chilliet 480056de88
Fix sanitizing regex and add a test case for uppercase in username
I did not find any test data that would fail with the previous regex,
 but still added data with uppercase to at least test that.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:10:38 +07:00
Côme Chilliet 158e73242e
Avoid use of iconv to get rid of unicode
Using iconv for translit depends upon server configuration, locale, and
 PHP version. Using htmlentities instead to have a consistent behavior
 independent of configuration.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-10-28 10:30:14 +07:00
Côme Chilliet 51398d706a
Use Psr\Log\LoggerInterface in OCA\User_LDAP\Access
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-10-12 17:19:51 +07:00
Côme Chilliet 437048e9b6
Avoid PHP errors when the LDAP attribute is not found
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-10-12 12:44:26 +07:00
Arthur Schiwon 6ab30a669b
ensure that user and group IDs in LDAP's tables are also max 64chars
- limitation by core tables (e.g. sharing), IDs are always 64chars
- when longer group IDs were requested they are hashed (does not affect
  displaynames)

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-09-24 17:29:29 +07:00
Gary Kim b78f3a57d1
Migrate HintException to OCP
Signed-off-by: Gary Kim <gary@garykim.dev>
2021-06-30 15:28:02 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Arthur Schiwon 2a5473e146
do not try to search after the last page
- saves an LDAP requests in these cases
- prevents a Protocol Error logged on < 7.3 API (for backports)

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-04-27 12:52:26 +07:00
dependabot-preview[bot] eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/nextcloud/coding-standard/releases)
- [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-02-18 13:31:24 +07:00
Christoph Wurst 6a3321cefe
Merge pull request #25101 from nextcloud/fix/noid/ldap-known-groups
LDAP: make actually use of batch read known groups
2021-01-29 10:57:31 +07:00