Completed
Push — master ( ca0f2f...6aa6d2 )
by Björn
33:52 queued 15:38
created
apps/files/lib/BackgroundJob/DeleteOrphanedItems.php 1 patch
Indentation   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -32,123 +32,123 @@
 block discarded – undo
32 32
  */
33 33
 class DeleteOrphanedItems extends TimedJob {
34 34
 
35
-	const CHUNK_SIZE = 200;
36
-
37
-	/** @var \OCP\IDBConnection */
38
-	protected $connection;
39
-
40
-	/** @var \OCP\ILogger */
41
-	protected $logger;
42
-
43
-	/**
44
-	 * Default interval in minutes
45
-	 *
46
-	 * @var int $defaultIntervalMin
47
-	 **/
48
-	protected $defaultIntervalMin = 60;
49
-
50
-	/**
51
-	 * sets the correct interval for this timed job
52
-	 */
53
-	public function __construct() {
54
-		$this->interval = $this->defaultIntervalMin * 60;
55
-		$this->connection = \OC::$server->getDatabaseConnection();
56
-		$this->logger = \OC::$server->getLogger();
57
-	}
58
-
59
-	/**
60
-	 * Makes the background job do its work
61
-	 *
62
-	 * @param array $argument unused argument
63
-	 */
64
-	public function run($argument) {
65
-		$this->cleanSystemTags();
66
-		$this->cleanUserTags();
67
-		$this->cleanComments();
68
-		$this->cleanCommentMarkers();
69
-	}
70
-
71
-	/**
72
-	 * Deleting orphaned system tag mappings
73
-	 *
74
-	 * @param string $table
75
-	 * @param string $idCol
76
-	 * @param string $typeCol
77
-	 * @return int Number of deleted entries
78
-	 */
79
-	protected function cleanUp($table, $idCol, $typeCol) {
80
-		$deletedEntries = 0;
81
-
82
-		$query = $this->connection->getQueryBuilder();
83
-		$query->select('t1.' . $idCol)
84
-			->from($table, 't1')
85
-			->where($query->expr()->eq($typeCol, $query->expr()->literal('files')))
86
-			->andWhere($query->expr()->isNull('t2.fileid'))
87
-			->leftJoin('t1', 'filecache', 't2', $query->expr()->eq($query->expr()->castColumn('t1.' . $idCol, IQueryBuilder::PARAM_INT), 't2.fileid'))
88
-			->groupBy('t1.' . $idCol)
89
-			->setMaxResults(self::CHUNK_SIZE);
90
-
91
-		$deleteQuery = $this->connection->getQueryBuilder();
92
-		$deleteQuery->delete($table)
93
-			->where($deleteQuery->expr()->eq($idCol, $deleteQuery->createParameter('objectid')));
94
-
95
-		$deletedInLastChunk = self::CHUNK_SIZE;
96
-		while ($deletedInLastChunk === self::CHUNK_SIZE) {
97
-			$result = $query->execute();
98
-			$deletedInLastChunk = 0;
99
-			while ($row = $result->fetch()) {
100
-				$deletedInLastChunk++;
101
-				$deletedEntries += $deleteQuery->setParameter('objectid', (int) $row[$idCol])
102
-					->execute();
103
-			}
104
-			$result->closeCursor();
105
-		}
106
-
107
-		return $deletedEntries;
108
-	}
109
-
110
-	/**
111
-	 * Deleting orphaned system tag mappings
112
-	 *
113
-	 * @return int Number of deleted entries
114
-	 */
115
-	protected function cleanSystemTags() {
116
-		$deletedEntries = $this->cleanUp('systemtag_object_mapping', 'objectid', 'objecttype');
117
-		$this->logger->debug("$deletedEntries orphaned system tag relations deleted", ['app' => 'DeleteOrphanedItems']);
118
-		return $deletedEntries;
119
-	}
120
-
121
-	/**
122
-	 * Deleting orphaned user tag mappings
123
-	 *
124
-	 * @return int Number of deleted entries
125
-	 */
126
-	protected function cleanUserTags() {
127
-		$deletedEntries = $this->cleanUp('vcategory_to_object', 'objid', 'type');
128
-		$this->logger->debug("$deletedEntries orphaned user tag relations deleted", ['app' => 'DeleteOrphanedItems']);
129
-		return $deletedEntries;
130
-	}
131
-
132
-	/**
133
-	 * Deleting orphaned comments
134
-	 *
135
-	 * @return int Number of deleted entries
136
-	 */
137
-	protected function cleanComments() {
138
-		$deletedEntries = $this->cleanUp('comments', 'object_id', 'object_type');
139
-		$this->logger->debug("$deletedEntries orphaned comments deleted", ['app' => 'DeleteOrphanedItems']);
140
-		return $deletedEntries;
141
-	}
142
-
143
-	/**
144
-	 * Deleting orphaned comment read markers
145
-	 *
146
-	 * @return int Number of deleted entries
147
-	 */
148
-	protected function cleanCommentMarkers() {
149
-		$deletedEntries = $this->cleanUp('comments_read_markers', 'object_id', 'object_type');
150
-		$this->logger->debug("$deletedEntries orphaned comment read marks deleted", ['app' => 'DeleteOrphanedItems']);
151
-		return $deletedEntries;
152
-	}
35
+    const CHUNK_SIZE = 200;
36
+
37
+    /** @var \OCP\IDBConnection */
38
+    protected $connection;
39
+
40
+    /** @var \OCP\ILogger */
41
+    protected $logger;
42
+
43
+    /**
44
+     * Default interval in minutes
45
+     *
46
+     * @var int $defaultIntervalMin
47
+     **/
48
+    protected $defaultIntervalMin = 60;
49
+
50
+    /**
51
+     * sets the correct interval for this timed job
52
+     */
53
+    public function __construct() {
54
+        $this->interval = $this->defaultIntervalMin * 60;
55
+        $this->connection = \OC::$server->getDatabaseConnection();
56
+        $this->logger = \OC::$server->getLogger();
57
+    }
58
+
59
+    /**
60
+     * Makes the background job do its work
61
+     *
62
+     * @param array $argument unused argument
63
+     */
64
+    public function run($argument) {
65
+        $this->cleanSystemTags();
66
+        $this->cleanUserTags();
67
+        $this->cleanComments();
68
+        $this->cleanCommentMarkers();
69
+    }
70
+
71
+    /**
72
+     * Deleting orphaned system tag mappings
73
+     *
74
+     * @param string $table
75
+     * @param string $idCol
76
+     * @param string $typeCol
77
+     * @return int Number of deleted entries
78
+     */
79
+    protected function cleanUp($table, $idCol, $typeCol) {
80
+        $deletedEntries = 0;
81
+
82
+        $query = $this->connection->getQueryBuilder();
83
+        $query->select('t1.' . $idCol)
84
+            ->from($table, 't1')
85
+            ->where($query->expr()->eq($typeCol, $query->expr()->literal('files')))
86
+            ->andWhere($query->expr()->isNull('t2.fileid'))
87
+            ->leftJoin('t1', 'filecache', 't2', $query->expr()->eq($query->expr()->castColumn('t1.' . $idCol, IQueryBuilder::PARAM_INT), 't2.fileid'))
88
+            ->groupBy('t1.' . $idCol)
89
+            ->setMaxResults(self::CHUNK_SIZE);
90
+
91
+        $deleteQuery = $this->connection->getQueryBuilder();
92
+        $deleteQuery->delete($table)
93
+            ->where($deleteQuery->expr()->eq($idCol, $deleteQuery->createParameter('objectid')));
94
+
95
+        $deletedInLastChunk = self::CHUNK_SIZE;
96
+        while ($deletedInLastChunk === self::CHUNK_SIZE) {
97
+            $result = $query->execute();
98
+            $deletedInLastChunk = 0;
99
+            while ($row = $result->fetch()) {
100
+                $deletedInLastChunk++;
101
+                $deletedEntries += $deleteQuery->setParameter('objectid', (int) $row[$idCol])
102
+                    ->execute();
103
+            }
104
+            $result->closeCursor();
105
+        }
106
+
107
+        return $deletedEntries;
108
+    }
109
+
110
+    /**
111
+     * Deleting orphaned system tag mappings
112
+     *
113
+     * @return int Number of deleted entries
114
+     */
115
+    protected function cleanSystemTags() {
116
+        $deletedEntries = $this->cleanUp('systemtag_object_mapping', 'objectid', 'objecttype');
117
+        $this->logger->debug("$deletedEntries orphaned system tag relations deleted", ['app' => 'DeleteOrphanedItems']);
118
+        return $deletedEntries;
119
+    }
120
+
121
+    /**
122
+     * Deleting orphaned user tag mappings
123
+     *
124
+     * @return int Number of deleted entries
125
+     */
126
+    protected function cleanUserTags() {
127
+        $deletedEntries = $this->cleanUp('vcategory_to_object', 'objid', 'type');
128
+        $this->logger->debug("$deletedEntries orphaned user tag relations deleted", ['app' => 'DeleteOrphanedItems']);
129
+        return $deletedEntries;
130
+    }
131
+
132
+    /**
133
+     * Deleting orphaned comments
134
+     *
135
+     * @return int Number of deleted entries
136
+     */
137
+    protected function cleanComments() {
138
+        $deletedEntries = $this->cleanUp('comments', 'object_id', 'object_type');
139
+        $this->logger->debug("$deletedEntries orphaned comments deleted", ['app' => 'DeleteOrphanedItems']);
140
+        return $deletedEntries;
141
+    }
142
+
143
+    /**
144
+     * Deleting orphaned comment read markers
145
+     *
146
+     * @return int Number of deleted entries
147
+     */
148
+    protected function cleanCommentMarkers() {
149
+        $deletedEntries = $this->cleanUp('comments_read_markers', 'object_id', 'object_type');
150
+        $this->logger->debug("$deletedEntries orphaned comment read marks deleted", ['app' => 'DeleteOrphanedItems']);
151
+        return $deletedEntries;
152
+    }
153 153
 
154 154
 }
Please login to merge, or discard this patch.
apps/files/lib/BackgroundJob/ScanFiles.php 1 patch
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -36,80 +36,80 @@
 block discarded – undo
36 36
  * @package OCA\Files\BackgroundJob
37 37
  */
38 38
 class ScanFiles extends \OC\BackgroundJob\TimedJob {
39
-	/** @var IConfig */
40
-	private $config;
41
-	/** @var IUserManager */
42
-	private $userManager;
43
-	/** @var IDBConnection */
44
-	private $dbConnection;
45
-	/** @var ILogger */
46
-	private $logger;
47
-	/** Amount of users that should get scanned per execution */
48
-	const USERS_PER_SESSION = 500;
39
+    /** @var IConfig */
40
+    private $config;
41
+    /** @var IUserManager */
42
+    private $userManager;
43
+    /** @var IDBConnection */
44
+    private $dbConnection;
45
+    /** @var ILogger */
46
+    private $logger;
47
+    /** Amount of users that should get scanned per execution */
48
+    const USERS_PER_SESSION = 500;
49 49
 
50
-	/**
51
-	 * @param IConfig|null $config
52
-	 * @param IUserManager|null $userManager
53
-	 * @param IDBConnection|null $dbConnection
54
-	 * @param ILogger|null $logger
55
-	 */
56
-	public function __construct(IConfig $config = null,
57
-								IUserManager $userManager = null,
58
-								IDBConnection $dbConnection = null,
59
-								ILogger $logger = null) {
60
-		// Run once per 10 minutes
61
-		$this->setInterval(60 * 10);
50
+    /**
51
+     * @param IConfig|null $config
52
+     * @param IUserManager|null $userManager
53
+     * @param IDBConnection|null $dbConnection
54
+     * @param ILogger|null $logger
55
+     */
56
+    public function __construct(IConfig $config = null,
57
+                                IUserManager $userManager = null,
58
+                                IDBConnection $dbConnection = null,
59
+                                ILogger $logger = null) {
60
+        // Run once per 10 minutes
61
+        $this->setInterval(60 * 10);
62 62
 
63
-		if (is_null($userManager) || is_null($config)) {
64
-			$this->fixDIForJobs();
65
-		} else {
66
-			$this->config = $config;
67
-			$this->userManager = $userManager;
68
-			$this->logger = $logger;
69
-		}
70
-	}
63
+        if (is_null($userManager) || is_null($config)) {
64
+            $this->fixDIForJobs();
65
+        } else {
66
+            $this->config = $config;
67
+            $this->userManager = $userManager;
68
+            $this->logger = $logger;
69
+        }
70
+    }
71 71
 
72
-	protected function fixDIForJobs() {
73
-		$this->config = \OC::$server->getConfig();
74
-		$this->userManager = \OC::$server->getUserManager();
75
-		$this->logger = \OC::$server->getLogger();
76
-	}
72
+    protected function fixDIForJobs() {
73
+        $this->config = \OC::$server->getConfig();
74
+        $this->userManager = \OC::$server->getUserManager();
75
+        $this->logger = \OC::$server->getLogger();
76
+    }
77 77
 
78
-	/**
79
-	 * @param IUser $user
80
-	 */
81
-	protected function runScanner(IUser $user) {
82
-		try {
83
-			$scanner = new Scanner(
84
-					$user->getUID(),
85
-					$this->dbConnection,
86
-					$this->logger
87
-			);
88
-			$scanner->backgroundScan('');
89
-		} catch (\Exception $e) {
90
-			$this->logger->logException($e, ['app' => 'files']);
91
-		}
92
-		\OC_Util::tearDownFS();
93
-	}
78
+    /**
79
+     * @param IUser $user
80
+     */
81
+    protected function runScanner(IUser $user) {
82
+        try {
83
+            $scanner = new Scanner(
84
+                    $user->getUID(),
85
+                    $this->dbConnection,
86
+                    $this->logger
87
+            );
88
+            $scanner->backgroundScan('');
89
+        } catch (\Exception $e) {
90
+            $this->logger->logException($e, ['app' => 'files']);
91
+        }
92
+        \OC_Util::tearDownFS();
93
+    }
94 94
 
95
-	/**
96
-	 * @param $argument
97
-	 * @throws \Exception
98
-	 */
99
-	protected function run($argument) {
100
-		$offset = $this->config->getAppValue('files', 'cronjob_scan_files', 0);
101
-		$users = $this->userManager->search('', self::USERS_PER_SESSION, $offset);
102
-		if (!count($users)) {
103
-			// No users found, reset offset and retry
104
-			$offset = 0;
105
-			$users = $this->userManager->search('', self::USERS_PER_SESSION);
106
-		}
95
+    /**
96
+     * @param $argument
97
+     * @throws \Exception
98
+     */
99
+    protected function run($argument) {
100
+        $offset = $this->config->getAppValue('files', 'cronjob_scan_files', 0);
101
+        $users = $this->userManager->search('', self::USERS_PER_SESSION, $offset);
102
+        if (!count($users)) {
103
+            // No users found, reset offset and retry
104
+            $offset = 0;
105
+            $users = $this->userManager->search('', self::USERS_PER_SESSION);
106
+        }
107 107
 
108
-		$offset += self::USERS_PER_SESSION;
109
-		$this->config->setAppValue('files', 'cronjob_scan_files', $offset);
108
+        $offset += self::USERS_PER_SESSION;
109
+        $this->config->setAppValue('files', 'cronjob_scan_files', $offset);
110 110
 
111
-		foreach ($users as $user) {
112
-			$this->runScanner($user);
113
-		}
114
-	}
111
+        foreach ($users as $user) {
112
+            $this->runScanner($user);
113
+        }
114
+    }
115 115
 }
Please login to merge, or discard this patch.
apps/user_ldap/templates/part.wizard-server.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,19 +9,19 @@
 block discarded – undo
9 9
 		<p>
10 10
 		<select id="ldap_serverconfig_chooser" name="ldap_serverconfig_chooser">
11 11
 		<?php if(count($_['serverConfigurationPrefixes']) === 0 ) {
12
-			?>
12
+            ?>
13 13
 				<option value="" selected><?php p($l->t('1. Server'));?></option>');
14 14
 			<?php
15
-		} else {
16
-			$i = 1;
17
-			$sel = ' selected';
18
-			foreach($_['serverConfigurationPrefixes'] as $prefix) {
19
-				?>
15
+        } else {
16
+            $i = 1;
17
+            $sel = ' selected';
18
+            foreach($_['serverConfigurationPrefixes'] as $prefix) {
19
+                ?>
20 20
 				<option value="<?php p($prefix); ?>"<?php p($sel); $sel = ''; ?>><?php p($l->t('%s. Server:', array($i++)));?> <?php p(' '.$_['serverConfigurationHosts'][$prefix]); ?></option>
21 21
 				<?php
22
-			}
23
-		}
24
-		?>
22
+            }
23
+        }
24
+        ?>
25 25
 		</select>
26 26
 		<button type="button" id="ldap_action_add_configuration"
27 27
 			name="ldap_action_add_configuration" class="icon-add icon-default-style"
Please login to merge, or discard this patch.
apps/user_ldap/ajax/setConfiguration.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,11 +36,11 @@
 block discarded – undo
36 36
 // only legacy checkboxes (Advanced and Expert tab) need to be handled here,
37 37
 // the Wizard-like tabs handle it on their own
38 38
 $chkboxes = array('ldap_configuration_active', 'ldap_override_main_server',
39
-				  'ldap_turn_off_cert_check');
39
+                    'ldap_turn_off_cert_check');
40 40
 foreach($chkboxes as $boxid) {
41
-	if(!isset($_POST[$boxid])) {
42
-		$_POST[$boxid] = 0;
43
-	}
41
+    if(!isset($_POST[$boxid])) {
42
+        $_POST[$boxid] = 0;
43
+    }
44 44
 }
45 45
 
46 46
 $ldapWrapper = new OCA\User_LDAP\LDAP();
Please login to merge, or discard this patch.
apps/user_ldap/ajax/getNewServerConfigPrefix.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@
 block discarded – undo
38 38
 
39 39
 $newConfig = new \OCA\User_LDAP\Configuration($nk, false);
40 40
 if(isset($_POST['copyConfig'])) {
41
-	$originalConfig = new \OCA\User_LDAP\Configuration($_POST['copyConfig']);
42
-	$newConfig->setConfiguration($originalConfig->getConfiguration());
41
+    $originalConfig = new \OCA\User_LDAP\Configuration($_POST['copyConfig']);
42
+    $newConfig->setConfiguration($originalConfig->getConfiguration());
43 43
 } else {
44
-	$configuration = new \OCA\User_LDAP\Configuration($nk, false);
45
-	$newConfig->setConfiguration($configuration->getDefaults());
46
-	$resultData['defaults'] = $configuration->getDefaults();
44
+    $configuration = new \OCA\User_LDAP\Configuration($nk, false);
45
+    $newConfig->setConfiguration($configuration->getDefaults());
46
+    $resultData['defaults'] = $configuration->getDefaults();
47 47
 }
48 48
 $newConfig->saveConfiguration();
49 49
 
Please login to merge, or discard this patch.
apps/user_ldap/lib/Mapping/GroupMapping.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
 */
30 30
 class GroupMapping extends AbstractMapping {
31 31
 
32
-	/**
33
-	* returns the DB table name which holds the mappings
34
-	* @return string
35
-	*/
36
-	protected function getTableName() {
37
-		return '*PREFIX*ldap_group_mapping';
38
-	}
32
+    /**
33
+     * returns the DB table name which holds the mappings
34
+     * @return string
35
+     */
36
+    protected function getTableName() {
37
+        return '*PREFIX*ldap_group_mapping';
38
+    }
39 39
 
40 40
 }
Please login to merge, or discard this patch.
apps/user_ldap/lib/Mapping/UserMapping.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
 */
30 30
 class UserMapping extends AbstractMapping {
31 31
 
32
-	/**
33
-	 * returns the DB table name which holds the mappings
34
-	 * @return string
35
-	 */
36
-	protected function getTableName() {
37
-		return '*PREFIX*ldap_user_mapping';
38
-	}
32
+    /**
33
+     * returns the DB table name which holds the mappings
34
+     * @return string
35
+     */
36
+    protected function getTableName() {
37
+        return '*PREFIX*ldap_user_mapping';
38
+    }
39 39
 
40 40
 }
Please login to merge, or discard this patch.
apps/user_ldap/lib/User/DeletedUsersIndex.php 1 patch
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -31,84 +31,84 @@
 block discarded – undo
31 31
  * @package OCA\User_LDAP
32 32
  */
33 33
 class DeletedUsersIndex {
34
-	/**
35
-	 * @var \OCP\IConfig $config
36
-	 */
37
-	protected $config;
34
+    /**
35
+     * @var \OCP\IConfig $config
36
+     */
37
+    protected $config;
38 38
 
39
-	/**
40
-	 * @var \OCP\IDBConnection $db
41
-	 */
42
-	protected $db;
39
+    /**
40
+     * @var \OCP\IDBConnection $db
41
+     */
42
+    protected $db;
43 43
 
44
-	/**
45
-	 * @var \OCA\User_LDAP\Mapping\UserMapping $mapping
46
-	 */
47
-	protected $mapping;
44
+    /**
45
+     * @var \OCA\User_LDAP\Mapping\UserMapping $mapping
46
+     */
47
+    protected $mapping;
48 48
 
49
-	/**
50
-	 * @var array $deletedUsers
51
-	 */
52
-	protected $deletedUsers;
49
+    /**
50
+     * @var array $deletedUsers
51
+     */
52
+    protected $deletedUsers;
53 53
 
54
-	/**
55
-	 * @param \OCP\IConfig $config
56
-	 * @param \OCP\IDBConnection $db
57
-	 * @param \OCA\User_LDAP\Mapping\UserMapping $mapping
58
-	 */
59
-	public function __construct(\OCP\IConfig $config, \OCP\IDBConnection $db, UserMapping $mapping) {
60
-		$this->config = $config;
61
-		$this->db = $db;
62
-		$this->mapping = $mapping;
63
-	}
54
+    /**
55
+     * @param \OCP\IConfig $config
56
+     * @param \OCP\IDBConnection $db
57
+     * @param \OCA\User_LDAP\Mapping\UserMapping $mapping
58
+     */
59
+    public function __construct(\OCP\IConfig $config, \OCP\IDBConnection $db, UserMapping $mapping) {
60
+        $this->config = $config;
61
+        $this->db = $db;
62
+        $this->mapping = $mapping;
63
+    }
64 64
 
65
-	/**
66
-	 * reads LDAP users marked as deleted from the database
67
-	 * @return \OCA\User_LDAP\User\OfflineUser[]
68
-	 */
69
-	private function fetchDeletedUsers() {
70
-		$deletedUsers = $this->config->getUsersForUserValue(
71
-			'user_ldap', 'isDeleted', '1');
65
+    /**
66
+     * reads LDAP users marked as deleted from the database
67
+     * @return \OCA\User_LDAP\User\OfflineUser[]
68
+     */
69
+    private function fetchDeletedUsers() {
70
+        $deletedUsers = $this->config->getUsersForUserValue(
71
+            'user_ldap', 'isDeleted', '1');
72 72
 
73
-		$userObjects = array();
74
-		foreach($deletedUsers as $user) {
75
-			$userObjects[] = new OfflineUser($user, $this->config, $this->db, $this->mapping);
76
-		}
77
-		$this->deletedUsers = $userObjects;
73
+        $userObjects = array();
74
+        foreach($deletedUsers as $user) {
75
+            $userObjects[] = new OfflineUser($user, $this->config, $this->db, $this->mapping);
76
+        }
77
+        $this->deletedUsers = $userObjects;
78 78
 
79
-		return $this->deletedUsers;
80
-	}
79
+        return $this->deletedUsers;
80
+    }
81 81
 
82
-	/**
83
-	 * returns all LDAP users that are marked as deleted
84
-	 * @return \OCA\User_LDAP\User\OfflineUser[]
85
-	 */
86
-	public function getUsers() {
87
-		if(is_array($this->deletedUsers)) {
88
-			return $this->deletedUsers;
89
-		}
90
-		return $this->fetchDeletedUsers();
91
-	}
82
+    /**
83
+     * returns all LDAP users that are marked as deleted
84
+     * @return \OCA\User_LDAP\User\OfflineUser[]
85
+     */
86
+    public function getUsers() {
87
+        if(is_array($this->deletedUsers)) {
88
+            return $this->deletedUsers;
89
+        }
90
+        return $this->fetchDeletedUsers();
91
+    }
92 92
 
93
-	/**
94
-	 * whether at least one user was detected as deleted
95
-	 * @return bool
96
-	 */
97
-	public function hasUsers() {
98
-		if($this->deletedUsers === false) {
99
-			$this->fetchDeletedUsers();
100
-		}
101
-		if(is_array($this->deletedUsers) && count($this->deletedUsers) > 0) {
102
-			return true;
103
-		}
104
-		return false;
105
-	}
93
+    /**
94
+     * whether at least one user was detected as deleted
95
+     * @return bool
96
+     */
97
+    public function hasUsers() {
98
+        if($this->deletedUsers === false) {
99
+            $this->fetchDeletedUsers();
100
+        }
101
+        if(is_array($this->deletedUsers) && count($this->deletedUsers) > 0) {
102
+            return true;
103
+        }
104
+        return false;
105
+    }
106 106
 
107
-	/**
108
-	 * marks a user as deleted
109
-	 * @param string $ocName
110
-	 */
111
-	public function markUser($ocName) {
112
-		$this->config->setUserValue($ocName, 'user_ldap', 'isDeleted', '1');
113
-	}
107
+    /**
108
+     * marks a user as deleted
109
+     * @param string $ocName
110
+     */
111
+    public function markUser($ocName) {
112
+        $this->config->setUserValue($ocName, 'user_ldap', 'isDeleted', '1');
113
+    }
114 114
 }
Please login to merge, or discard this patch.
apps/user_ldap/lib/User/IUserTools.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@
 block discarded – undo
30 30
  * defines methods that are required by User class for LDAP interaction
31 31
  */
32 32
 interface IUserTools {
33
-	public function getConnection();
33
+    public function getConnection();
34 34
 
35
-	public function readAttribute($dn, $attr, $filter = 'objectClass=*');
35
+    public function readAttribute($dn, $attr, $filter = 'objectClass=*');
36 36
 
37
-	public function stringResemblesDN($string);
37
+    public function stringResemblesDN($string);
38 38
 
39
-	public function dn2username($dn, $ldapname = null);
39
+    public function dn2username($dn, $ldapname = null);
40 40
 
41
-	public function username2dn($name);
41
+    public function username2dn($name);
42 42
 }
Please login to merge, or discard this patch.