mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 22:34:24 +02:00
LdapUserGroupBackend: Do not permit to link different directories
I cannot think of a valid usecase right now. In case someone got one, revert this commit and make use of the backend itself and not only its configuration. refs #7343
This commit is contained in:
parent
0ab192cd1f
commit
02d2ea682e
@ -544,7 +544,7 @@ class LdapUserGroupBackend /*extends LdapRepository*/ implements UserGroupBacken
|
|||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*
|
*
|
||||||
* @throws ConfigurationError In case a linked user backend does not exist or is not a LdapUserBackend
|
* @throws ConfigurationError In case a linked user backend does not exist or is invalid
|
||||||
*/
|
*/
|
||||||
public function setConfig(ConfigObject $config)
|
public function setConfig(ConfigObject $config)
|
||||||
{
|
{
|
||||||
@ -562,6 +562,17 @@ class LdapUserGroupBackend /*extends LdapRepository*/ implements UserGroupBacken
|
|||||||
throw new ConfigurationError('User backend "%s" is not of type LDAP', $config->user_backend);
|
throw new ConfigurationError('User backend "%s" is not of type LDAP', $config->user_backend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
$this->ds->getHostname() !== $userBackend->getDataSource()->getHostname()
|
||||||
|
|| $this->ds->getPort() !== $userBackend->getDataSource()->getPort()
|
||||||
|
) {
|
||||||
|
// TODO(jom): Elaborate whether it makes sense to link directories on different hosts
|
||||||
|
throw new ConfigurationError(
|
||||||
|
'It is required that a linked user backend refers to the '
|
||||||
|
. 'same directory as it\'s user group backend counterpart'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$defaults->merge(array(
|
$defaults->merge(array(
|
||||||
'user_base_dn' => $userBackend->getBaseDn(),
|
'user_base_dn' => $userBackend->getBaseDn(),
|
||||||
'user_class' => $userBackend->getUserClass(),
|
'user_class' => $userBackend->getUserClass(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user