Skip to content

ActiveDirectory.config.php incorrectly parsed #856

@abaldoni

Description

@abaldoni

[X]: This is a bug and not a question.

[X]: I understand that the best way to resolve this issue is to solve it and propose a Pull Request.

Describe the bug**

The ActiveDirectory.config.php format is as follows:

return [
    'settings' => [
            'domain.controllers' => 'list,of,dcs',
            'port' => 389,
            'username' => 'username',
...

This file is parsed as expected: this has been verified by

var_dump(Configuration::Instance()->File(ActiveDirectoryConfigKeys::CONFIG_ID))

The ActiveDirectoryConfigKeys.php however specifies that all settings should be inside a 'activedirectory' section:

    public const DOMAIN_CONTROLLERS = [
        'key' => 'domain.controllers',
        'type' => 'string',
        'default' => '',
        'label' => 'Domain Controllers',
        'description' => 'Comma separated list of domain controllers',
        'section' => 'activedirectory'
    ];

since in ActiveDirectoryOptions.php configuration keys are retrieved by:

$this->GetConfig(ActiveDirectoryConfigKeys::DOMAIN_CONTROLLERS)

If ActiveDirectory.config.php is changed as follows

return [
    'settings' => [
         'activedirectory' => [
            'domain.controllers' => 'list,of,dcs',
            'port' => 389,
            'username' => 'username',
...

it will be parsed without errors but the result will be empty:

object(ConfigurationFile)#174 (2) { ["_values":"ConfigurationFile":private]=> array(0) { } 
	["_configKeysClass":"ConfigurationFile":private]=> string(25) "ActiveDirectoryConfigKeys" }

Specifications

  • LibreBooking version: 4.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleNo activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions