Code Duplication    Length = 10-10 lines in 2 locations

apps/user_ldap/lib/Access.php 2 locations

@@ 462-471 (lines=10) @@
459
	 * @param string $ldapName optional, the display name of the object
460
	 * @return string|false with the name to use in Nextcloud, false on DN outside of search DN
461
	 */
462
	public function dn2groupname($fdn, $ldapName = null) {
463
		//To avoid bypassing the base DN settings under certain circumstances
464
		//with the group support, check whether the provided DN matches one of
465
		//the given Bases
466
		if(!$this->isDNPartOfBase($fdn, $this->connection->ldapBaseGroups)) {
467
			return false;
468
		}
469
470
		return $this->dn2ocname($fdn, $ldapName, false);
471
	}
472
473
	/**
474
	 * accepts an array of group DNs and tests whether they match the user
@@ 519-528 (lines=10) @@
516
	 * @param string $ldapName optional, the display name of the object
517
	 * @return string|false with with the name to use in Nextcloud
518
	 */
519
	public function dn2username($fdn, $ldapName = null) {
520
		//To avoid bypassing the base DN settings under certain circumstances
521
		//with the group support, check whether the provided DN matches one of
522
		//the given Bases
523
		if(!$this->isDNPartOfBase($fdn, $this->connection->ldapBaseUsers)) {
524
			return false;
525
		}
526
527
		return $this->dn2ocname($fdn, $ldapName, true);
528
	}
529
530
	/**
531
	 * returns an internal Nextcloud name for the given LDAP DN, false on DN outside of search DN