fix LDAP install for systems without ldap extension (#846)

This commit is contained in:
Kevin Papst
2019-06-11 01:25:49 +02:00
committed by GitHub
parent 0c0e9c2f71
commit 833968a87d
23 changed files with 82 additions and 326 deletions

View File

@@ -494,7 +494,6 @@ class Configuration implements ConfigurationInterface
$node
->addDefaultsIfNotSet()
->children()
->booleanNode('active')->defaultFalse()->end()
->arrayNode('connection')
->addDefaultsIfNotSet()
->children()
@@ -591,19 +590,13 @@ class Configuration implements ConfigurationInterface
->end()
->validate()
->ifTrue(static function ($v) {
return $v['active'] && !extension_loaded('ldap');
return null !== $v['connection']['host'] && !extension_loaded('ldap');
})
->thenInvalid('LDAP is activated, but the LDAP PHP extension is not loaded.')
->end()
->validate()
->ifTrue(static function ($v) {
return $v['active'] && empty($v['connection']['host']);
})
->thenInvalid('The "ldap.connection.host" config must be set if LDAP is activated.')
->end()
->validate()
->ifTrue(static function ($v) {
return $v['active'] && empty($v['user']['baseDn']);
return null !== $v['connection']['host'] && empty($v['user']['baseDn']);
})
->thenInvalid('The "ldap.user.baseDn" config must be set if LDAP is activated.')
->end()