summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/user
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/user
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/user')
-rw-r--r--apps/user_ldap/lib/user/deletedusersindex.php12
-rw-r--r--apps/user_ldap/lib/user/iusertools.php4
-rw-r--r--apps/user_ldap/lib/user/manager.php2
-rw-r--r--apps/user_ldap/lib/user/offlineuser.php12
4 files changed, 13 insertions, 17 deletions
diff --git a/apps/user_ldap/lib/user/deletedusersindex.php b/apps/user_ldap/lib/user/deletedusersindex.php
index 0d8bacffe94..e544d29bad5 100644
--- a/apps/user_ldap/lib/user/deletedusersindex.php
+++ b/apps/user_ldap/lib/user/deletedusersindex.php
@@ -24,7 +24,7 @@
namespace OCA\user_ldap\lib\user;
use OCA\user_ldap\lib\user\OfflineUser;
-use OCA\user_ldap\lib\Access;
+use OCA\User_LDAP\Mapping\UserMapping;
/**
* Class DeletedUsersIndex
@@ -42,9 +42,9 @@ class DeletedUsersIndex {
protected $db;
/**
- * @var \OCA\user_ldap\lib\Access $access
+ * @var \OCA\User_LDAP\Mapping\UserMapping $mapping
*/
- protected $access;
+ protected $mapping;
/**
* @var int $limit
@@ -56,10 +56,10 @@ class DeletedUsersIndex {
*/
protected $deletedUsers = false;
- public function __construct(\OC\Preferences $preferences, \OCP\IDBConnection $db, Access $access) {
+ public function __construct(\OC\Preferences $preferences, \OCP\IDBConnection $db, UserMapping $mapping) {
$this->preferences = $preferences;
$this->db = $db;
- $this->access = $access;
+ $this->mapping = $mapping;
}
/**
@@ -84,7 +84,7 @@ class DeletedUsersIndex {
$userObjects = array();
foreach($deletedUsers as $user) {
- $userObjects[] = new OfflineUser($user, $this->preferences, $this->db, $this->access);
+ $userObjects[] = new OfflineUser($user, $this->preferences, $this->db, $this->mapping);
}
$this->deletedUsers[$key] = $userObjects;
diff --git a/apps/user_ldap/lib/user/iusertools.php b/apps/user_ldap/lib/user/iusertools.php
index ffdef62410d..fcb00d2f746 100644
--- a/apps/user_ldap/lib/user/iusertools.php
+++ b/apps/user_ldap/lib/user/iusertools.php
@@ -38,8 +38,4 @@ interface IUserTools {
public function dn2username($dn, $ldapname = null);
public function username2dn($name);
-
- //temporary hack for LDAP user cleanup, will be removed in OC 8.
- public function ocname2dn($name, $isUser);
-
}
diff --git a/apps/user_ldap/lib/user/manager.php b/apps/user_ldap/lib/user/manager.php
index 1bcc9b96d8a..cd4f4441e1d 100644
--- a/apps/user_ldap/lib/user/manager.php
+++ b/apps/user_ldap/lib/user/manager.php
@@ -154,7 +154,7 @@ class Manager {
$id,
new \OC\Preferences(\OC_DB::getConnection()),
\OC::$server->getDatabaseConnection(),
- $this->access);
+ $this->access->getUserMapper());
}
protected function createInstancyByUserName($id) {
diff --git a/apps/user_ldap/lib/user/offlineuser.php b/apps/user_ldap/lib/user/offlineuser.php
index 7750348a280..7cf48bc05b1 100644
--- a/apps/user_ldap/lib/user/offlineuser.php
+++ b/apps/user_ldap/lib/user/offlineuser.php
@@ -23,7 +23,7 @@
namespace OCA\user_ldap\lib\user;
-use OCA\user_ldap\lib\Access;
+use OCA\User_LDAP\Mapping\UserMapping;
class OfflineUser {
/**
@@ -67,15 +67,15 @@ class OfflineUser {
*/
protected $db;
/**
- * @var \OCA\user_ldap\lib\Access
+ * @var OCA\User_LDAP\Mapping\UserMapping
*/
- protected $access;
+ protected $mapping;
- public function __construct($ocName, \OC\Preferences $preferences, \OCP\IDBConnection $db, Access $access) {
+ public function __construct($ocName, \OC\Preferences $preferences, \OCP\IDBConnection $db, UserMapping $mapping) {
$this->ocName = $ocName;
$this->preferences = $preferences;
$this->db = $db;
- $this->access = $access;
+ $this->mapping = $mapping;
$this->fetchDetails();
}
@@ -176,7 +176,7 @@ class OfflineUser {
$this->$property = $this->preferences->getValue($this->ocName, $app, $property, '');
}
- $dn = $this->access->ocname2dn($this->ocName, true);
+ $dn = $this->mapping->getDNByName($this->ocName);
$this->dn = ($dn !== false) ? $dn : '';
$this->determineShares();