summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/proxy.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-11-05 13:05:07 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-12-19 18:26:12 +0100
commitec0f80fee927ca572671ac7c733b960fb027e91f (patch)
treeb9b0bdbb7bb88557ea95b5872f1e0f9f0d10a99b /apps/user_ldap/lib/proxy.php
parent87e3e2925044831e5fd962207b4a6e9cd29b3f4f (diff)
downloadnextcloud-server-ec0f80fee927ca572671ac7c733b960fb027e91f.tar.gz
nextcloud-server-ec0f80fee927ca572671ac7c733b960fb027e91f.zip
Split mapping from Access and Helper classes into it's own. Fully test them, too.
remove unused methods split mapping methods off from Access class fix DB query handling move 'clear mapping' methods from static helper to new mapping class add tests test directly with DB finishing tests and fix return value from setDNbyUUID add corresponding class for groups and make abstract test class neutral. helper tests is now obsolete as the tested functions were moved to the new mapper class. add missing info to PHPDoc add unmap method fix namespaces fix test inheritance PHPDoc and a small code restructure for scrutinizer, no effective changes PostgreSQL does not accept LIMIT in DELETE queries phpdoc fixes, no code changes
Diffstat (limited to 'apps/user_ldap/lib/proxy.php')
-rw-r--r--apps/user_ldap/lib/proxy.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/proxy.php
index 73a52a7ddd9..39d4b36c8bb 100644
--- a/apps/user_ldap/lib/proxy.php
+++ b/apps/user_ldap/lib/proxy.php
@@ -24,6 +24,8 @@
namespace OCA\user_ldap\lib;
use OCA\user_ldap\lib\Access;
+use OCA\User_LDAP\Mapping\UserMapping;
+use OCA\User_LDAP\Mapping\GroupMapping;
abstract class Proxy {
static private $accesses = array();
@@ -45,17 +47,23 @@ abstract class Proxy {
static $fs;
static $log;
static $avatarM;
+ static $userMap;
+ static $groupMap;
if(is_null($fs)) {
$ocConfig = \OC::$server->getConfig();
$fs = new FilesystemHelper();
$log = new LogWrapper();
$avatarM = \OC::$server->getAvatarManager();
+ $userMap = new UserMapping(\OC::$server->getDatabaseConnection());
+ $groupMap = new GroupMapping(\OC::$server->getDatabaseConnection());
}
$userManager =
new user\Manager($ocConfig, $fs, $log, $avatarM, new \OCP\Image());
$connector = new Connection($this->ldap, $configPrefix);
- self::$accesses[$configPrefix] =
- new Access($connector, $this->ldap, $userManager);
+ $access = new Access($connector, $this->ldap, $userManager);
+ $access->setUserMapper($userMap);
+ $access->setGroupMapper($groupMap);
+ self::$accesses[$configPrefix] = $access;
}
/**