Commit Graph

1076 Commits (fb901b0d93da99b0a49e963a6a35fd82b7051a98)

Author SHA1 Message Date
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
Carl Schwan 25519b7089 Add backtrace to ldap profiler collector
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-20 16:55:44 +07:00
Côme Chilliet 3dedfd34b9
Clean up LDAP Wizard typing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 16:51:39 +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
Carl Schwan 99a752922f Fix psalm
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-20 13:14:39 +07:00
Carl Schwan 60ec5e655c Check if cache is present with isset
Otherwise we get false for empty array

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-20 13:14:39 +07:00
Côme Chilliet 1a6a6c985a Bring back small fixes by Carl
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 13:14:39 +07:00
Côme Chilliet 746a5fb7e0 Fix LDAP recursive nested group support
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 13:14:39 +07:00
Carl Schwan be5338e572 Revert Carl changes on apps/user_ldap/lib/Group_LDAP.php
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-20 13:14:31 +07:00
Côme Chilliet 8d07bc9b20
Cleanup typing and improve logging
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:56:17 +07:00
Côme Chilliet 81064b3d22
Fix ldap_parse_result call
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:56:17 +07:00
Côme Chilliet e872f461f2
Adapt interface to new search signature
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:56:16 +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 d6e49cd2de
Remove useless getReadArgs/setReadArgs methods from PagedResults
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
Carl Schwan 1b12a08ec2 Fix user_ldap tests
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-20 12:09:06 +07:00
Carl Schwan e0fbd39840 Add back runtime cache for intermediate ldap read results
This is a small optimization that save a few LDAP queries

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-20 12:09:06 +07:00
Carl Schwan 33be3f754a Only cache base inGroup search
And not intermediate search for nested groups, this is causing issues
othewise with nested groups

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-20 12:09:06 +07:00
Côme Chilliet 604b5ace12 Add missing copyright author in Group_LDAP
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:09:06 +07:00