Code Duplication    Length = 6-19 lines in 2 locations

apps/user_ldap/lib/Access.php 1 location

@@ 1477-1495 (lines=19) @@
1474
			throw new \InvalidArgumentException('String expected');
1475
		}
1476
		$blocks = explode('-', $guid);
1477
		if(count($blocks) !== 5) {
1478
			/*
1479
			 * Why not throw an Exception instead? This method is a utility
1480
			 * called only when trying to figure out whether a "missing" known
1481
			 * LDAP user was or was not renamed on the LDAP server. And this
1482
			 * even on the use case that a reverse lookup is needed (UUID known,
1483
			 * not DN), i.e. when finding users (search dialog, users page,
1484
			 * login, …) this will not be fired. This occurs only if shares from
1485
			 * a users are supposed to be mounted who cannot be found. Throwing
1486
			 * an exception here would kill the experience for a valid, acting
1487
			 * user. Instead we write a log message.
1488
			 */
1489
			\OC::$server->getLogger()->info(
1490
				'Passed string does not resemble a valid GUID. Known UUID ' .
1491
				'({uuid}) probably does not match UUID configuration.',
1492
				[ 'app' => 'user_ldap', 'uuid' => $guid ]
1493
			);
1494
			return $guid;
1495
		}
1496
		for($i=0; $i < 3; $i++) {
1497
			$pairs = str_split($blocks[$i], 2);
1498
			$pairs = array_reverse($pairs);

apps/user_ldap/lib/User_LDAP.php 1 location

@@ 290-295 (lines=6) @@
287
	*/
288
	public function deleteUser($uid) {
289
		$marked = $this->ocConfig->getUserValue($uid, 'user_ldap', 'isDeleted', 0);
290
		if(intval($marked) === 0) {
291
			\OC::$server->getLogger()->notice(
292
				'User '.$uid . ' is not marked as deleted, not cleaning up.',
293
				array('app' => 'user_ldap'));
294
			return false;
295
		}
296
		\OC::$server->getLogger()->info('Cleaning up after user ' . $uid,
297
			array('app' => 'user_ldap'));
298