Code Duplication    Length = 10-10 lines in 2 locations

apps/user_ldap/lib/Access.php 2 locations

@@ 454-463 (lines=10) @@
451
	 * @param string $ldapName optional, the display name of the object
452
	 * @return string|false with the name to use in Nextcloud, false on DN outside of search DN
453
	 */
454
	public function dn2groupname($fdn, $ldapName = null) {
455
		//To avoid bypassing the base DN settings under certain circumstances
456
		//with the group support, check whether the provided DN matches one of
457
		//the given Bases
458
		if(!$this->isDNPartOfBase($fdn, $this->connection->ldapBaseGroups)) {
459
			return false;
460
		}
461
462
		return $this->dn2ocname($fdn, $ldapName, false);
463
	}
464
465
	/**
466
	 * accepts an array of group DNs and tests whether they match the user
@@ 510-519 (lines=10) @@
507
	 * @param string $ldapName optional, the display name of the object
508
	 * @return string|false with with the name to use in Nextcloud
509
	 */
510
	public function dn2username($fdn, $ldapName = null) {
511
		//To avoid bypassing the base DN settings under certain circumstances
512
		//with the group support, check whether the provided DN matches one of
513
		//the given Bases
514
		if(!$this->isDNPartOfBase($fdn, $this->connection->ldapBaseUsers)) {
515
			return false;
516
		}
517
518
		return $this->dn2ocname($fdn, $ldapName, true);
519
	}
520
521
	/**
522
	 * returns an internal Nextcloud name for the given LDAP DN, false on DN outside of search DN