diff options
Diffstat (limited to 'apps/user_ldap/lib/access.php')
-rw-r--r-- | apps/user_ldap/lib/access.php | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 00fb8acc59a..f3657176f70 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -76,6 +76,18 @@ class Access extends LDAPUtility implements user\IUserTools { } /** + * returns the User Mapper + * @throws \Exception + * @return AbstractMapping + */ + public function getUserMapper() { + if(is_null($this->userMapper)) { + throw new \Exception('UserMapper was not assigned to this Access instance.'); + } + return $this->userMapper; + } + + /** * sets the Group Mapper * @param AbstractMapping $mapper */ @@ -84,6 +96,18 @@ class Access extends LDAPUtility implements user\IUserTools { } /** + * returns the Group Mapper + * @throws \Exception + * @return AbstractMapping + */ + public function getGroupMapper() { + if(is_null($this->groupMapper)) { + throw new \Exception('GroupMapper was not assigned to this Access instance.'); + } + return $this->groupMapper; + } + + /** * @return bool */ private function checkConnection() { @@ -290,6 +314,7 @@ class Access extends LDAPUtility implements user\IUserTools { } /** + public function ocname2dn($name, $isUser) { * returns the internal ownCloud name for the given LDAP DN of the group, false on DN outside of search DN or failure * @param string $fdn the dn of the group object * @param string $ldapName optional, the display name of the object @@ -332,10 +357,10 @@ class Access extends LDAPUtility implements user\IUserTools { */ public function dn2ocname($fdn, $ldapName = null, $isUser = true) { if($isUser) { - $mapper = $this->userMapper; + $mapper = $this->getUserMapper(); $nameAttribute = $this->connection->ldapUserDisplayName; } else { - $mapper = $this->groupMapper; + $mapper = $this->getGroupMapper(); $nameAttribute = $this->connection->ldapGroupDisplayName; } |