Code Duplication    Length = 6-19 lines in 2 locations

apps/user_ldap/lib/access.php 1 location

@@ 1423-1441 (lines=19) @@
1420
			throw new \InvalidArgumentException('String expected');
1421
		}
1422
		$blocks = explode('-', $guid);
1423
		if(count($blocks) !== 5) {
1424
			/*
1425
			 * Why not throw an Exception instead? This method is a utility
1426
			 * called only when trying to figure out whether a "missing" known
1427
			 * LDAP user was or was not renamed on the LDAP server. And this
1428
			 * even on the use case that a reverse lookup is needed (UUID known,
1429
			 * not DN), i.e. when finding users (search dialog, users page,
1430
			 * login, …) this will not be fired. This occurs only if shares from
1431
			 * a users are supposed to be mounted who cannot be found. Throwing
1432
			 * an exception here would kill the experience for a valid, acting
1433
			 * user. Instead we write a log message.
1434
			 */
1435
			\OC::$server->getLogger()->info(
1436
				'Passed string does not resemble a valid GUID. Known UUID ' .
1437
				'({uuid}) probably does not match UUID configuration.',
1438
				[ 'app' => 'user_ldap', 'uuid' => $guid ]
1439
			);
1440
			return $guid;
1441
		}
1442
		for($i=0; $i < 3; $i++) {
1443
			$pairs = str_split($blocks[$i], 2);
1444
			$pairs = array_reverse($pairs);

apps/user_ldap/user_ldap.php 1 location

@@ 277-282 (lines=6) @@
274
	*/
275
	public function deleteUser($uid) {
276
		$marked = $this->ocConfig->getUserValue($uid, 'user_ldap', 'isDeleted', 0);
277
		if(intval($marked) === 0) {
278
			\OC::$server->getLogger()->notice(
279
				'User '.$uid . ' is not marked as deleted, not cleaning up.',
280
				array('app' => 'user_ldap'));
281
			return false;
282
		}
283
		\OC::$server->getLogger()->info('Cleaning up after user ' . $uid,
284
			array('app' => 'user_ldap'));
285