From d7655972ed509be7866d4f112849081255b381fe Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 28 Sep 2015 10:56:15 +0200 Subject: [PATCH] LdapRepository: Add method isAmbiguous() refs #9950 --- library/Icinga/Repository/LdapRepository.php | 24 +++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Repository/LdapRepository.php b/library/Icinga/Repository/LdapRepository.php index cf61d1f9e..5e79c41bb 100644 --- a/library/Icinga/Repository/LdapRepository.php +++ b/library/Icinga/Repository/LdapRepository.php @@ -42,6 +42,15 @@ abstract class LdapRepository extends Repository 'groupofuniquenames' => 'groupOfUniqueNames' ); + /** + * Object attributes whose value is not distinguished name + * + * @var array + */ + protected $ambiguousAttributes = array( + 'posixGroup' => 'memberUid' + ); + /** * Create a new LDAP repository object * @@ -68,4 +77,17 @@ abstract class LdapRepository extends Repository return $name; } -} \ No newline at end of file + + /** + * Return whether the given object attribute's value is not a distinguished name + * + * @param string $objectClass + * @param string $attributeName + * + * @return bool + */ + protected function isAmbiguous($objectClass, $attributeName) + { + return isset($this->ambiguousAttributes[$objectClass][$attributeName]); + } +}