Code Duplication    Length = 19-21 lines in 2 locations

apps/user_ldap/lib/wizard.php 2 locations

@@ 542-560 (lines=19) @@
539
	 * @return WizardResult|false
540
	 * @throws \Exception
541
	 */
542
	public function getGroupFilter() {
543
		if(!$this->checkRequirements(array('ldapHost',
544
										   'ldapPort',
545
										   'ldapBase',
546
										   ))) {
547
			return false;
548
		}
549
		//make sure the use display name is set
550
		$displayName = $this->configuration->ldapGroupDisplayName;
551
		if(empty($displayName)) {
552
			$d = $this->configuration->getDefaults();
553
			$this->applyFind('ldap_group_display_name',
554
							 $d['ldap_group_display_name']);
555
		}
556
		$filter = $this->composeLdapFilter(self::LFILTER_GROUP_LIST);
557
558
		$this->applyFind('ldap_group_filter', $filter);
559
		return $this->result;
560
	}
561
562
	/**
563
	 * @return WizardResult|false
@@ 566-586 (lines=21) @@
563
	 * @return WizardResult|false
564
	 * @throws \Exception
565
	 */
566
	public function getUserListFilter() {
567
		if(!$this->checkRequirements(array('ldapHost',
568
										   'ldapPort',
569
										   'ldapBase',
570
										   ))) {
571
			return false;
572
		}
573
		//make sure the use display name is set
574
		$displayName = $this->configuration->ldapUserDisplayName;
575
		if(empty($displayName)) {
576
			$d = $this->configuration->getDefaults();
577
			$this->applyFind('ldap_display_name', $d['ldap_display_name']);
578
		}
579
		$filter = $this->composeLdapFilter(self::LFILTER_USER_LIST);
580
		if(!$filter) {
581
			throw new \Exception('Cannot create filter');
582
		}
583
584
		$this->applyFind('ldap_userlist_filter', $filter);
585
		return $this->result;
586
	}
587
588
	/**
589
	 * @return bool|WizardResult