Completed
Pull Request — master (#4150)
by Robin
15:39
created
lib/private/User/Database.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -185,15 +185,15 @@  discard block
 block discarded – undo
185 185
 		$parameters = [];
186 186
 		$searchLike = '';
187 187
 		if ($search !== '') {
188
-			$parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%';
189
-			$parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%';
188
+			$parameters[] = '%'.\OC::$server->getDatabaseConnection()->escapeLikeParameter($search).'%';
189
+			$parameters[] = '%'.\OC::$server->getDatabaseConnection()->escapeLikeParameter($search).'%';
190 190
 			$searchLike = ' WHERE LOWER(`displayname`) LIKE LOWER(?) OR '
191 191
 				. 'LOWER(`uid`) LIKE LOWER(?)';
192 192
 		}
193 193
 
194 194
 		$displayNames = array();
195 195
 		$query = \OC_DB::prepare('SELECT `uid`, `displayname` FROM `*PREFIX*users`'
196
-			. $searchLike .' ORDER BY LOWER(`displayname`), LOWER(`uid`) ASC', $limit, $offset);
196
+			. $searchLike.' ORDER BY LOWER(`displayname`), LOWER(`uid`) ASC', $limit, $offset);
197 197
 		$result = $query->execute($parameters);
198 198
 		while ($row = $result->fetchRow()) {
199 199
 			$displayNames[$row['uid']] = $row['displayname'];
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 		if ($row) {
220 220
 			$storedHash = $row['password'];
221 221
 			$newHash = '';
222
-			if(\OC::$server->getHasher()->verify($password, $storedHash, $newHash)) {
223
-				if(!empty($newHash)) {
222
+			if (\OC::$server->getHasher()->verify($password, $storedHash, $newHash)) {
223
+				if (!empty($newHash)) {
224 224
 					$this->setPassword($uid, $password);
225 225
 				}
226 226
 				return $row['uid'];
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 		if (!isset($this->cache[$uid])) {
242 242
 			//guests $uid could be NULL or ''
243 243
 			if ($uid === '') {
244
-				$this->cache[$uid]=false;
244
+				$this->cache[$uid] = false;
245 245
 				return true;
246 246
 			}
247 247
 
@@ -281,11 +281,11 @@  discard block
 block discarded – undo
281 281
 		$parameters = [];
282 282
 		$searchLike = '';
283 283
 		if ($search !== '') {
284
-			$parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%';
284
+			$parameters[] = '%'.\OC::$server->getDatabaseConnection()->escapeLikeParameter($search).'%';
285 285
 			$searchLike = ' WHERE LOWER(`uid`) LIKE LOWER(?)';
286 286
 		}
287 287
 
288
-		$query = \OC_DB::prepare('SELECT `uid` FROM `*PREFIX*users`' . $searchLike . ' ORDER BY LOWER(`uid`) ASC', $limit, $offset);
288
+		$query = \OC_DB::prepare('SELECT `uid` FROM `*PREFIX*users`'.$searchLike.' ORDER BY LOWER(`uid`) ASC', $limit, $offset);
289 289
 		$result = $query->execute($parameters);
290 290
 		$users = array();
291 291
 		while ($row = $result->fetchRow()) {
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 	 */
312 312
 	public function getHome($uid) {
313 313
 		if ($this->userExists($uid)) {
314
-			return \OC::$server->getConfig()->getSystemValue("datadirectory", \OC::$SERVERROOT . "/data") . '/' . $uid;
314
+			return \OC::$server->getConfig()->getSystemValue("datadirectory", \OC::$SERVERROOT."/data").'/'.$uid;
315 315
 		}
316 316
 
317 317
 		return false;
@@ -357,12 +357,12 @@  discard block
 block discarded – undo
357 357
 	 * Backend name to be shown in user management
358 358
 	 * @return string the name of the backend to be shown
359 359
 	 */
360
-	public function getBackendName(){
360
+	public function getBackendName() {
361 361
 		return 'Database';
362 362
 	}
363 363
 
364 364
 	public static function preLoginNameUsedAsUserName($param) {
365
-		if(!isset($param['uid'])) {
365
+		if (!isset($param['uid'])) {
366 366
 			throw new \Exception('key uid is expected to be set in $param');
367 367
 		}
368 368
 
Please login to merge, or discard this patch.