Skip to content
Snippets Groups Projects
Commit 65fbea3a authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Inject config

parent 656d9da8
No related branches found
No related tags found
No related merge requests found
Pipeline #63001 passed
......@@ -20,7 +20,7 @@ class DbpRelayLdapPersonProviderExtension extends ConfigurableExtension
$loader->load('services.yaml');
// Inject the config value into the UCardService service
$definition = $container->getDefinition('Dbp\Relay\LdapPersonProviderBundle\Service\UCardService');
$definition = $container->getDefinition('Dbp\Relay\LdapPersonProviderBundle\Service\LDAPApi');
$definition->addMethodCall('setConfig', [$mergedConfig]);
}
......
......@@ -96,6 +96,17 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface
$this->birthdayAttributeName = $this->params->get('app.ldap.attributes.birthday') ?? '';
}
public function setConfig(array $config)
{
$this->providerConfig = [
'hosts' => [$config['host'] ?? ''],
'base_dn' => $config['base_dn'] ?? '',
'username' => $config['username'] ?? '',
'password' => $config['password'] ?? '',
'use_tls' => true,
];
}
public function setDeploymentEnvironment(string $env)
{
$this->deploymentEnv = $env;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment