Code Duplication    Length = 10-10 lines in 2 locations

apps/user_ldap/lib/Access.php 2 locations

@@ 441-450 (lines=10) @@
438
	 * @param string $ldapName optional, the display name of the object
439
	 * @return string|false with the name to use in ownCloud, false on DN outside of search DN
440
	 */
441
	public function dn2groupname($fdn, $ldapName = null) {
442
		//To avoid bypassing the base DN settings under certain circumstances
443
		//with the group support, check whether the provided DN matches one of
444
		//the given Bases
445
		if(!$this->isDNPartOfBase($fdn, $this->connection->ldapBaseGroups)) {
446
			return false;
447
		}
448
449
		return $this->dn2ocname($fdn, $ldapName, false);
450
	}
451
452
	/**
453
	 * accepts an array of group DNs and tests whether they match the user
@@ 497-506 (lines=10) @@
494
	 * @param string $ldapName optional, the display name of the object
495
	 * @return string|false with with the name to use in ownCloud
496
	 */
497
	public function dn2username($fdn, $ldapName = null) {
498
		//To avoid bypassing the base DN settings under certain circumstances
499
		//with the group support, check whether the provided DN matches one of
500
		//the given Bases
501
		if(!$this->isDNPartOfBase($fdn, $this->connection->ldapBaseUsers)) {
502
			return false;
503
		}
504
505
		return $this->dn2ocname($fdn, $ldapName, true);
506
	}
507
508
	/**
509
	 * returns an internal ownCloud name for the given LDAP DN, false on DN outside of search DN