summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/access.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-01-09 10:47:02 +0100
committerLukas Reschke <lukas@owncloud.com>2015-01-09 10:47:02 +0100
commita5099b01f93ec81602c8facba04233c7bc65ed47 (patch)
treefb2ac4d03d0210848c0c22a241ad956b7bf54c8d /apps/user_ldap/lib/access.php
parentb4606ec24f507ff6ad6f720d3c4f026221a163d7 (diff)
parentc1a79d24c54d3c1d6ecb2c65540f9b52a3d6dc31 (diff)
downloadnextcloud-server-a5099b01f93ec81602c8facba04233c7bc65ed47.tar.gz
nextcloud-server-a5099b01f93ec81602c8facba04233c7bc65ed47.zip
Merge pull request #12984 from owncloud/ldap-user-cleanup-master
Ldap user cleanup master
Diffstat (limited to 'apps/user_ldap/lib/access.php')
-rw-r--r--apps/user_ldap/lib/access.php29
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;
}