Commit Graph

3342 Commits (fb901b0d93da99b0a49e963a6a35fd82b7051a98)

Author SHA1 Message Date
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 5e74b1e9ad
Adapt test to User_Proxy constructor
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-25 16:16:59 +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
Nextcloud bot 54ce35ebd8
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-10-23 02:14:46 +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 8b5586b793
Fix autoload
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:56:54 +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
Côme Chilliet 69f9e9f387 Removed unused use declaration
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:09:06 +07:00
Côme Chilliet 150e6adbc5 Fix types in docblocks
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:09:06 +07:00
Côme Chilliet 7437673add Add testing of nested group membership
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:09:06 +07:00
Côme Chilliet 6ed0d0b8b1 Refactor group membership listing for nested groups
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:09:06 +07:00
Côme Chilliet 02ccce17f7 Add tests for nested groups
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:09:06 +07:00
Côme Chilliet 8b19cfcd88 Small optimisation of _groupMembers
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>
2022-10-20 12:09:06 +07:00
Côme Chilliet d07f43dc12 Refactor _groupMembers to correctly use cache on intermediate results
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-20 12:09:06 +07:00
Carl Schwan 6522f8a6d9 Fix merging list with null
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>
2022-10-20 12:09:06 +07:00
Carl Schwan 49aa352069 Unify a bit the types of the fetcher
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>
2022-10-20 12:09:06 +07:00
Carl Schwan 0fd7a51e3c Add more type hinting
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-20 12:09:06 +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
Arthur Schiwon ad2fdbe377 Refactor code to split common loop
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-10-20 12:08:24 +07:00
Arthur Schiwon 1e4ac22c94 Make it possible to return nested records whem walking over groups
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-10-20 12:08:09 +07:00
Arthur Schiwon 50d4963772
[LDAP] throw exception only against prov api
- unbreaks functionality for end users when on demand mapping takes
  place

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-10-18 23:26:16 +07:00
Arthur Schiwon 8e8acf2d90
LDAP to no register new users when outside of fair use or over limits
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-10-18 12:57:43 +07:00
Nextcloud bot 5ab021c6bf
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-10-16 02:14:37 +07:00
Nextcloud bot aa003dc971
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-10-14 02:14:47 +07:00
Côme Chilliet 1d2d6e864d
Avoid double ldap_unbind in Wizard.php
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-11 09:54:04 +07:00
Côme Chilliet 0a9a749174
Fix code style with codesniffer
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-10-11 09:53:27 +07:00
Nextcloud bot 00485eff56
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-10-09 02:14:12 +07:00
Nextcloud bot afdb75d98b
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-10-08 02:14:39 +07:00
Nextcloud bot 0112a2925a
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-10-07 02:14:13 +07:00
Nextcloud bot 1401943e7b
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-10-06 02:18:56 +07:00
Nextcloud bot dbd0cf054c
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-10-01 02:16:55 +07:00
Nextcloud bot 11ec90d8ae
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-09-23 02:28:39 +07:00
Joas Schilling 05845e11a8
Master is now 26
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-09-22 11:56:15 +07:00
Nextcloud bot 1930c3bbb9
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-09-22 02:32:35 +07:00
Joas Schilling 29af54f10d
Merge pull request #34147 from nextcloud/bugfix/noid/fix-avatar-cleanup-on-user-delete
Fix avatar cleanup on user delete
2022-09-20 17:11:05 +07:00
Joas Schilling c443ecfbff
Rebuild autoloader
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-09-20 10:33:26 +07:00
Nextcloud bot 3ac720aaca
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-09-20 02:32:43 +07:00
Nextcloud bot c3a87e8c48
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-09-19 02:32:20 +07:00
Nextcloud bot 88b66442a2
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-09-16 02:26:19 +07:00
Andy Xheli f5d40c9ae5
Updated LDAP Copy Button
Signed-off-by: Andy Xheli <axheli@axtsolutions.com>

Signed-off-by: Andy Xheli <axheli@axtsolutions.com>
2022-09-13 13:21:45 +07:00
Nextcloud bot a42976f3db
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-09-10 02:30:26 +07:00
Vincent Van Houtte c323022d06 Add ldap-unix-socket support - squashed commits to files Connection.php, Configuration.php, Wizard.php, LDAP.php and view.js
Signed-off-by: Vincent Van Houtte <vvh@aplusv.be>
2022-09-09 16:53:05 +07:00
Nextcloud bot 107aeb36e5
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-09-08 02:26:07 +07:00
Nextcloud bot 2d709e45c0
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-09-07 02:25:42 +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
Nextcloud bot a0e4445cb5
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-28 02:23:58 +07:00
Nextcloud bot 5de5b75ede
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-27 02:23:58 +07:00
Nextcloud bot 2fcae35e0f
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-26 02:24:48 +07:00
Nextcloud bot 56df202d52
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-25 02:25:01 +07:00
Carl Schwan bd7ab89d2a
Merge pull request #33593 from nextcloud/improve-binary-caching
Move findBinaryFinder and isFunctionEnabled away from OC_Helper
2022-08-24 13:09:55 +07:00
Nextcloud bot 03c8bf7067
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-24 02:27:22 +07:00
Carl Schwan 9b8ca9ad1f
Move findBinaryFinder and isFunctionEnabled away from OC_Helper
findBinaryFinder is now a service that is still private but with some
minor optimization (remove the hasKey check).

isFunctionEnabled is now in OCP\Util

Both function are still keep but all internal usage in nextcloud/server
were migrated to the new usage, so that we can remove it in 26

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-23 19:44:04 +07:00
Carl Schwan b888c61463
Merge pull request #33047 from nextcloud/fix/ijob-logger-deprecated
Deprecated ILogger from IJob
2022-08-23 16:55:42 +07:00
blizzz 73205a77ba
Merge pull request #33639 from nextcloud/bugfix/noid/fix-plural-usage-in-ldap
Fix plural usage in LDAP wizard
2022-08-23 10:11:04 +07:00
Nextcloud bot 4991448601
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-23 02:24:42 +07:00
Joas Schilling f4885ee3ba
Remove unused method
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-08-22 14:15:32 +07:00
Joas Schilling ef60257110
Fix plural usage in LDAP wizard
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-08-22 14:14:47 +07:00
Nextcloud bot 9704b16822
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-15 02:24:47 +07:00
Nextcloud bot 033bafc026
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-14 02:24:52 +07:00
Carl Schwan f8b13ecd60
Merge pull request #32363 from nextcloud/cleanup/remove-long-deprecated-classes
Remove OCP\App and OCP\BackgroundJob
2022-08-08 17:05:11 +07:00
Carl Schwan 48d9c4d2b0
Port existing server code to new interface
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-08 17:03:19 +07:00
Nextcloud bot fd580d0aa2
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-08-06 02:25:10 +07:00
Carl Schwan 458c2fa297
Remove OCP\App and OCP\BackgroundJob
Both deprecated since NC 23

IAppManager is the replacement for OCP\App unfortunately it can't be
dependency injected in classes used by the installed otherwise the
database connection is initialised too early

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-01 09:46:40 +07:00
Carl Schwan d5c23dbb9f Move CappedMemoryCache to OCP
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>
2022-07-14 15:54:31 +07:00
Carl Schwan 16b5e6bc7f
Merge pull request #32973 from nextcloud/cleanup/avatar-code
Cleanup avatar related code
2022-07-11 11:56:39 +07:00
Nextcloud bot 3dfb5c9d75
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-07-08 02:24:38 +07:00
Carl Schwan ec5cbdeb7f Make Color class public
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-05 14:44:44 +07:00
Nextcloud bot e9ca761a93
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-07-04 02:23:32 +07:00
Arthur Schiwon 8185a3d701
adjust tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-06-28 22:46:51 +07:00
blizzz 52c957e751
simplify
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>

Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
2022-06-28 16:07:11 +07:00
Arthur Schiwon d97f32dd8e
delete groups in chunks instead of one by one
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-06-28 14:35:18 +07:00
Arthur Schiwon 632f2d7760
cleanup LDAP's UpdateGroups
- TimedJob from API
- DI of config
- property types
- throws hints in phpdoc
- argument and return types
- replace depracet execute() with executeStatement or -Query
- a missing return statement

Co-authored-by: Carl Schwan <carl@carlschwan.eu>

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-06-28 14:34:56 +07:00
Nextcloud bot a4647bbf6e
[tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
2022-06-22 02:28:08 +07:00
Carl Schwan 7d0804e85c
Merge pull request #32861 from nextcloud/fix/remove-at-matcher-in-user_ldap-tests
Remove deprecated at() matcher from user_ldap tests
2022-06-21 11:47:43 +07:00
Carl Schwan 35d8bdc840 Fix profiler trying to serialize invalid utf8
The cookie value contains invalid utf8 characters most of the time so
let's just ignore it as it is also not that interesting to analyse.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-06-20 11:11:12 +07:00
Côme Chilliet 113028581c
Remove bogus expects from user_ldap tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-14 15:44:51 +07:00
Côme Chilliet 129584c966
Remove deprecated at() matcher from user_ldap tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-13 15:19:25 +07:00