Skip to content

fix(user_ldap): Remove usages of deprecated IServerContainer#57100

Merged
CarlSchwan merged 6 commits intomasterfrom
fix/remove-iservercontainer-from-user-ldap
Mar 2, 2026
Merged

fix(user_ldap): Remove usages of deprecated IServerContainer#57100
CarlSchwan merged 6 commits intomasterfrom
fix/remove-iservercontainer-from-user-ldap

Conversation

@come-nc
Copy link
Contributor

@come-nc come-nc commented Dec 15, 2025

Summary

Checklist

@come-nc come-nc self-assigned this Dec 15, 2025
@come-nc come-nc added the 2. developing Work in progress label Dec 15, 2025
@come-nc come-nc force-pushed the fix/remove-iservercontainer-from-user-ldap branch from 031c7ec to f0ef985 Compare December 16, 2025 10:15
@come-nc come-nc force-pushed the fix/remove-iservercontainer-from-user-ldap branch from f0ef985 to 5f4e0ac Compare February 26, 2026 11:45
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc force-pushed the fix/remove-iservercontainer-from-user-ldap branch from 12f24dc to cc36555 Compare February 26, 2026 12:31
@come-nc come-nc marked this pull request as ready for review February 26, 2026 12:58
@come-nc come-nc requested a review from a team as a code owner February 26, 2026 12:58
@come-nc come-nc requested review from ArtificialOwl, icewind1991, leftybournes and salmart-dev and removed request for a team February 26, 2026 12:58
@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 26, 2026
@come-nc come-nc requested review from CarlSchwan and blizzz February 26, 2026 12:58
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@CarlSchwan
Copy link
Member

test failures are related

@CarlSchwan
Copy link
Member

Still failing :)

-use OCA\User_LDAP\LDAP;
 use OCA\User_LDAP\User_Proxy;
 use OCP\IConfig;
-use OCP\Server;
 
 use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputArgument;
@@ -82,10 +79,6 @@ class Search extends Command {
        }
 
        protected function execute(InputInterface $input, OutputInterface $output): int {
-               $helper = Server::get(Helper::class);
-               $configPrefixes = $helper->getServerConfigurationPrefixes(true);
-               $ldapWrapper = new LDAP();
-
                $offset = (int)$input->getOption('offset');
                $limit = (int)$input->getOption('limit');
                $this->validateOffsetAndLimit($offset, $limit);
diff --git a/apps/user_ldap/lib/Command/SetConfig.php b/apps/user_ldap/lib/Command/SetConfig.php
index 7e9efcf34d0..cec8e9478c5 100644
--- a/apps/user_ldap/lib/Command/SetConfig.php
+++ b/apps/user_ldap/lib/Command/SetConfig.php
@@ -11,13 +11,23 @@ use OCA\User_LDAP\Configuration;
 use OCA\User_LDAP\ConnectionFactory;
 use OCA\User_LDAP\Helper;
 use OCA\User_LDAP\LDAP;
+use OCP\IConfig;
+use OCP\Profiler\IProfiler;
 use OCP\Server;
+use Psr\Log\LoggerInterface;
 use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class SetConfig extends Command {
+       public function __construct(
+               private IProfiler $profiler,
+               private LoggerInterface $logger,
+               private IConfig $config,
+       ) {
+               parent::__construct();
+       }
        protected function configure(): void {
                $this
                        ->setName('ldap:set-config')
@@ -65,7 +75,7 @@ class SetConfig extends Command {
                $configHolder->$key = $value;
                $configHolder->saveConfiguration();
 
-               $connectionFactory = new ConnectionFactory(new LDAP());
+               $connectionFactory = new ConnectionFactory(new LDAP($this->profiler, $this->config, $this->logger));
                $connectionFactory->get($configID)->clearCache();
        }
 }

@come-nc come-nc force-pushed the fix/remove-iservercontainer-from-user-ldap branch from bbe1ad5 to 2ca809f Compare March 2, 2026 15:25
…code

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc come-nc force-pushed the fix/remove-iservercontainer-from-user-ldap branch from 2ca809f to 279d5c2 Compare March 2, 2026 15:34
@CarlSchwan CarlSchwan merged commit 5fa368c into master Mar 2, 2026
202 of 208 checks passed
@CarlSchwan CarlSchwan deleted the fix/remove-iservercontainer-from-user-ldap branch March 2, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants