aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/access.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-12-20 16:09:04 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-12-20 16:09:04 +0100
commit144d95de7dde29cd85e795cdcd7ac1576639d641 (patch)
tree67de63f5c3c43b49cbb29cffcd6eb855eff68cb1 /apps/user_ldap/lib/access.php
parent4fa39250e714b3ee5aa16a5f9ce8c77daa44311b (diff)
downloadnextcloud-server-144d95de7dde29cd85e795cdcd7ac1576639d641.tar.gz
nextcloud-server-144d95de7dde29cd85e795cdcd7ac1576639d641.zip
basic adjustments for OC 8. I.e. no visible issues, LDAP tests pass.
Diffstat (limited to 'apps/user_ldap/lib/access.php')
-rw-r--r--apps/user_ldap/lib/access.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 692afb98f99..3e9869b4d71 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() {
@@ -333,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;
}