LdapUserGroupBackend: Register the user backend for later use

refs #9772
This commit is contained in:
Johannes Meyer 2015-09-29 09:44:01 +02:00
parent 1cede5bd1a
commit b7ddb6e4c2
1 changed files with 31 additions and 0 deletions

View File

@ -15,6 +15,13 @@ use Icinga\User;
class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInterface
{
/**
* The user backend being associated with this user group backend
*
* @var LdapUserBackend
*/
protected $userBackend;
/**
* The base DN to use for a user query
*
@ -103,6 +110,29 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt
)
);
/**
* Set the user backend to be associated with this user group backend
*
* @param LdapUserBackend $backend
*
* @return $this
*/
public function setUserBackend(LdapUserBackend $backend)
{
$this->userBackend = $backend;
return $this;
}
/**
* Return the user backend being associated with this user group backend
*
* @return LdapUserBackend
*/
public function getUserBackend()
{
return $this->userBackend;
}
/**
* Set the base DN to use for a user query
*
@ -522,6 +552,7 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt
);
}
$this->setUserBackend($userBackend);
$defaults->merge(array(
'user_base_dn' => $userBackend->getBaseDn(),
'user_class' => $userBackend->getUserClass(),