Code Duplication    Length = 14-14 lines in 2 locations

apps/user_ldap/lib/Group_LDAP.php 2 locations

@@ 379-392 (lines=14) @@
376
	 * @param int $offset
377
	 * @return string[]
378
	 */
379
	public function getUsersInGidNumber($groupDN, $search = '', $limit = -1, $offset = 0) {
380
		try {
381
			$filter = $this->prepareFilterForUsersHasGidNumber($groupDN, $search);
382
			$users = $this->access->fetchListOfUsers(
383
				$filter,
384
				[$this->access->connection->ldapUserDisplayName, 'dn'],
385
				$limit,
386
				$offset
387
			);
388
			return $this->access->nextcloudUserNames($users);
389
		} catch (\Exception $e) {
390
			return [];
391
		}
392
	}
393
394
	/**
395
	 * returns the number of users that have the given group as gid number
@@ 543-556 (lines=14) @@
540
	 * @param int $offset
541
	 * @return string[]
542
	 */
543
	public function getUsersInPrimaryGroup($groupDN, $search = '', $limit = -1, $offset = 0) {
544
		try {
545
			$filter = $this->prepareFilterForUsersInPrimaryGroup($groupDN, $search);
546
			$users = $this->access->fetchListOfUsers(
547
				$filter,
548
				array($this->access->connection->ldapUserDisplayName, 'dn'),
549
				$limit,
550
				$offset
551
			);
552
			return $this->access->nextcloudUserNames($users);
553
		} catch (\Exception $e) {
554
			return array();
555
		}
556
	}
557
558
	/**
559
	 * returns the number of users that have the given group as primary group