Code Duplication    Length = 10-10 lines in 2 locations

apps/user_ldap/lib/access.php 2 locations

@@ 342-351 (lines=10) @@
339
	 * @param string $ldapName optional, the display name of the object
340
	 * @return string|false with the name to use in ownCloud, false on DN outside of search DN
341
	 */
342
	public function dn2groupname($fdn, $ldapName = null) {
343
		//To avoid bypassing the base DN settings under certain circumstances
344
		//with the group support, check whether the provided DN matches one of
345
		//the given Bases
346
		if(!$this->isDNPartOfBase($fdn, $this->connection->ldapBaseGroups)) {
347
			return false;
348
		}
349
350
		return $this->dn2ocname($fdn, $ldapName, false);
351
	}
352
353
	/**
354
	 * accepts an array of group DNs and tests whether they match the user
@@ 397-406 (lines=10) @@
394
	 * @param string $ldapName optional, the display name of the object
395
	 * @return string|false with with the name to use in ownCloud
396
	 */
397
	public function dn2username($fdn, $ldapName = null) {
398
		//To avoid bypassing the base DN settings under certain circumstances
399
		//with the group support, check whether the provided DN matches one of
400
		//the given Bases
401
		if(!$this->isDNPartOfBase($fdn, $this->connection->ldapBaseUsers)) {
402
			return false;
403
		}
404
405
		return $this->dn2ocname($fdn, $ldapName, true);
406
	}
407
408
	/**
409
	 * returns an internal ownCloud name for the given LDAP DN, false on DN outside of search DN