diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-01-06 17:50:06 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-01-06 17:50:06 +0100 |
commit | e724b78694cb17c7a3ff4427ae103b01baa4688c (patch) | |
tree | 21ad2d4a24d1e4e3a8da5e5d0ee6f1dd8ff40cf1 /apps/user_ldap/lib | |
parent | 61ed363f820a3b25b68289ed2c03ff5e5edfed91 (diff) | |
download | nextcloud-server-e724b78694cb17c7a3ff4427ae103b01baa4688c.tar.gz nextcloud-server-e724b78694cb17c7a3ff4427ae103b01baa4688c.zip |
smaller fixes: coding style, PHPdoc, typos and few for DI
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r-- | apps/user_ldap/lib/jobs.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/lib/jobs/cleanup.php | 32 | ||||
-rw-r--r-- | apps/user_ldap/lib/user/deletedusersindex.php | 7 | ||||
-rw-r--r-- | apps/user_ldap/lib/user/offlineuser.php | 6 |
4 files changed, 26 insertions, 23 deletions
diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/jobs.php index 391a10d31f8..e8e6df0b9d0 100644 --- a/apps/user_ldap/lib/jobs.php +++ b/apps/user_ldap/lib/jobs.php @@ -24,6 +24,7 @@ namespace OCA\user_ldap\lib; use OCA\User_LDAP\Mapping\GroupMapping; +use OCA\User_LDAP\Mapping\UserMapping; class Jobs extends \OC\BackgroundJob\TimedJob { static private $groupsFromDB; @@ -172,6 +173,9 @@ class Jobs extends \OC\BackgroundJob\TimedJob { $connector = new Connection($ldapWrapper, $configPrefixes[0]); $ldapAccess = new Access($connector, $ldapWrapper, $userManager); $groupMapper = new GroupMapping(\OC::$server->getDatabaseConnection()); + $userMapper = new UserMapping(\OC::$server->getDatabaseConnection()); + $ldapAccess->setGroupMapper($groupMapper); + $ldapAccess->setUserMapper($userMapper); self::$groupBE = new \OCA\user_ldap\GROUP_LDAP($ldapAccess); } else { self::$groupBE = new \OCA\user_ldap\Group_Proxy($configPrefixes, $ldapWrapper); diff --git a/apps/user_ldap/lib/jobs/cleanup.php b/apps/user_ldap/lib/jobs/cleanup.php index 35252d6f6e5..83cfeb048c8 100644 --- a/apps/user_ldap/lib/jobs/cleanup.php +++ b/apps/user_ldap/lib/jobs/cleanup.php @@ -22,29 +22,22 @@ use \OCA\User_LDAP\Mapping\UserMapping; * @package OCA\user_ldap\lib; */ class CleanUp extends \OC\BackgroundJob\TimedJob { - /** - * @var int $limit amount of users that should be checked per run - */ + /** @var int $limit amount of users that should be checked per run */ protected $limit = 50; - /** - * @var \OCP\UserInterface $userBackend - */ + /** @var int $defaultIntervalMin default interval in minutes */ + protected $defaultIntervalMin = 51; + + /** @var \OCP\UserInterface $userBackend */ protected $userBackend; - /** - * @var \OCP\IConfig $ocConfig - */ + /** @var \OCP\IConfig $ocConfig */ protected $ocConfig; - /** - * @var \OCP\IDBConnection $db - */ + /** @var \OCP\IDBConnection $db */ protected $db; - /** - * @var Helper $ldapHelper - */ + /** @var Helper $ldapHelper */ protected $ldapHelper; /** @var \OCA\User_LDAP\Mapping\UserMapping */ @@ -53,11 +46,6 @@ class CleanUp extends \OC\BackgroundJob\TimedJob { /** @var \OCA\User_LDAP\lib\User\DeletedUsersIndex */ protected $dui; - /** - * @var int $defaultIntervalMin default interval in minutes - */ - protected $defaultIntervalMin = 51; - public function __construct() { $minutes = \OC::$server->getConfig()->getSystemValue( 'ldapUserCleanupInterval', strval($this->defaultIntervalMin)); @@ -177,7 +165,7 @@ class CleanUp extends \OC\BackgroundJob\TimedJob { * checks users whether they are still existing * @param array $users result from getMappedUsers() */ - private function checkUsers($users) { + private function checkUsers(array $users) { foreach($users as $user) { $this->checkUser($user); } @@ -187,7 +175,7 @@ class CleanUp extends \OC\BackgroundJob\TimedJob { * checks whether a user is still existing in LDAP * @param string[] $user */ - private function checkUser($user) { + private function checkUser(array $user) { if($this->userBackend->userExistsOnLDAP($user['name'])) { //still available, all good diff --git a/apps/user_ldap/lib/user/deletedusersindex.php b/apps/user_ldap/lib/user/deletedusersindex.php index 67585530279..e17ed3384da 100644 --- a/apps/user_ldap/lib/user/deletedusersindex.php +++ b/apps/user_ldap/lib/user/deletedusersindex.php @@ -49,8 +49,13 @@ class DeletedUsersIndex { /** * @var array $deletedUsers */ - protected $deletedUsers = false; + protected $deletedUsers; + /** + * @param OCP\IConfig $config + * @param OCP\IDBConnection $db + * @param OCA\User_LDAP\Mapping\UserMapping $mapping + */ public function __construct(\OCP\IConfig $config, \OCP\IDBConnection $db, UserMapping $mapping) { $this->config = $config; $this->db = $db; diff --git a/apps/user_ldap/lib/user/offlineuser.php b/apps/user_ldap/lib/user/offlineuser.php index 9383320fae2..e5c87fd23fc 100644 --- a/apps/user_ldap/lib/user/offlineuser.php +++ b/apps/user_ldap/lib/user/offlineuser.php @@ -71,6 +71,12 @@ class OfflineUser { */ protected $mapping; + /** + * @param string $ocName + * @param OCP\IConfig $config + * @param OCP\IDBConnection $db + * @param OCA\User_LDAP\Mapping\UserMapping $mapping + */ public function __construct($ocName, \OCP\IConfig $config, \OCP\IDBConnection $db, UserMapping $mapping) { $this->ocName = $ocName; $this->config = $config; |