From db2e9df5f000b129e9dad2ce801baada0a17a8a4 Mon Sep 17 00:00:00 2001
From: Joas Schilling <nickvergessen@owncloud.com>
Date: Thu, 12 May 2016 16:46:41 +0200
Subject: [PATCH] Move Job to a better class name

---
 apps/user_ldap/appinfo/info.xml                        | 4 ++--
 apps/user_ldap/lib/{jobs.php => Jobs/UpdateGroups.php} | 8 +++++---
 lib/private/Repair/DropOldJobs.php                     | 4 ++++
 3 files changed, 11 insertions(+), 5 deletions(-)
 rename apps/user_ldap/lib/{jobs.php => Jobs/UpdateGroups.php} (97%)

diff --git a/apps/user_ldap/appinfo/info.xml b/apps/user_ldap/appinfo/info.xml
index 9805996b56f..23dbc5278e5 100644
--- a/apps/user_ldap/appinfo/info.xml
+++ b/apps/user_ldap/appinfo/info.xml
@@ -24,7 +24,7 @@ A user logs into ownCloud with their LDAP or AD credentials, and is granted acce
 	<namespace>User_LDAP</namespace>
 
 	<background-jobs>
-		<job>OCA\user_ldap\lib\Jobs</job>
-		<job>\OCA\User_LDAP\Jobs\CleanUp</job>
+		<job>OCA\user_ldap\Jobs\UpdateGroups</job>
+		<job>OCA\User_LDAP\Jobs\CleanUp</job>
 	</background-jobs>
 </info>
diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/Jobs/UpdateGroups.php
similarity index 97%
rename from apps/user_ldap/lib/jobs.php
rename to apps/user_ldap/lib/Jobs/UpdateGroups.php
index 9b0398c068d..3ea74959f5c 100644
--- a/apps/user_ldap/lib/jobs.php
+++ b/apps/user_ldap/lib/Jobs/UpdateGroups.php
@@ -26,8 +26,10 @@
  *
  */
 
-namespace OCA\user_ldap\lib;
+namespace OCA\User_LDAP\Jobs;
 
+use OCA\User_LDAP\Access;
+use OCA\User_LDAP\Connection;
 use OCA\User_LDAP\FilesystemHelper;
 use OCA\User_LDAP\Helper;
 use OCA\User_LDAP\LDAP;
@@ -36,7 +38,7 @@ use OCA\User_LDAP\Mapping\GroupMapping;
 use OCA\User_LDAP\Mapping\UserMapping;
 use OCA\User_LDAP\User\Manager;
 
-class Jobs extends \OC\BackgroundJob\TimedJob {
+class UpdateGroups extends \OC\BackgroundJob\TimedJob {
 	static private $groupsFromDB;
 
 	static private $groupBE;
@@ -50,7 +52,7 @@ class Jobs extends \OC\BackgroundJob\TimedJob {
 	 * @param mixed $argument
 	 */
 	public function run($argument){
-		Jobs::updateGroups();
+		self::updateGroups();
 	}
 
 	static public function updateGroups() {
diff --git a/lib/private/Repair/DropOldJobs.php b/lib/private/Repair/DropOldJobs.php
index c040aa03961..f0ebf29065d 100644
--- a/lib/private/Repair/DropOldJobs.php
+++ b/lib/private/Repair/DropOldJobs.php
@@ -73,8 +73,12 @@ class DropOldJobs implements IRepairStep {
 			['class' => 'OC_Cache_FileGlobalGC', 'arguments' => null],
 			['class' => 'OC\Cache\FileGlobalGC', 'arguments' => null],
 			['class' => 'OCA\Files\BackgroundJob\DeleteOrphanedTagsJob', 'arguments' => null],
+
 			['class' => 'OCA\Files_sharing\Lib\DeleteOrphanedSharesJob', 'arguments' => null],
 			['class' => 'OCA\Files_sharing\ExpireSharesJob', 'arguments' => null],
+
+			['class' => 'OCA\user_ldap\lib\Jobs', 'arguments' => null],
+			['class' => '\OCA\User_LDAP\Jobs\CleanUp', 'arguments' => null],
 		];
 	}
 
-- 
GitLab