public function getListGroupEmail($groupDn = null) {
		$result = [];
		if (empty($groupDn)) {
			return $result;
		}

		$cacheKey = md5($groupDn);
		$cached = Cache::read($cacheKey, CAKE_SETTINGS_APP_CACHE_KEY_AD_GROUP_MEMBER_MAIL);
		if (!empty($cached)) {
			return $cached;
		}

		$conditions = '(&(userAccountControl:1.2.840.113556.1.4.803:=512)(!(useraccountcontrol:1.2.840.113556.1.4.803:=2))(objectClass=user)(' . CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MEMBER_OF . '=' . $groupDn . '))';
		$fields = [CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_NAME, CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MAIL];
		$order = CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MAIL;

		$data = $this->find('all', compact('conditions', 'fields', 'order'));
		if (empty($data)) {
			return $result;
		}

		foreach ($data as $dataItem) {
			$mail = Hash::get($dataItem, $this->alias . '.' . CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MAIL);
			$name = Hash::get($dataItem, $this->alias . '.' . CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_NAME);
			if (empty($mail)) {
				continue;
			}
			$result[$mail] = $name;
		}
		Cache::write($cacheKey, $result, CAKE_SETTINGS_APP_CACHE_KEY_AD_GROUP_MEMBER_MAIL);

		return $result;
	}
public function getListGroupEmail($groupDn = null) {
		$result = [];
		if (empty($groupDn)) {
			return $result;
		}

		$cacheKey = md5($groupDn);
		$cached = Cache::read($cacheKey, CAKE_SETTINGS_APP_CACHE_KEY_AD_GROUP_MEMBER_MAIL);
		if (!empty($cached)) {
			return $cached;
		}

		$conditions = '(&(userAccountControl:1.2.840.113556.1.4.803:=512)(!(useraccountcontrol:1.2.840.113556.1.4.803:=2))(objectClass=user)(' . CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MEMBER_OF . '=' . $groupDn . '))';
		$fields = [CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_NAME, CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MAIL];
		$order = CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MAIL;

		$data = $this->find('all', compact('conditions', 'fields', 'order'));
		if (empty($data)) {
			return $result;
		}

		foreach ($data as $dataItem) {
			$mail = Hash::get($dataItem, $this->alias . '.' . CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MAIL);
			$name = Hash::get($dataItem, $this->alias . '.' . CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_NAME);
			if (empty($mail)) {
				continue;
			}
			$result[$mail] = $name;
		}
		Cache::write($cacheKey, $result, CAKE_SETTINGS_APP_CACHE_KEY_AD_GROUP_MEMBER_MAIL);

		return $result;
	}
public function getListGroupEmail ( $ groupDn = null ) { $ result = [ ] ; if ( empty ( $ groupDn ) ) { return $ result ; } $ cacheKey = md5 ( $ groupDn ) ; $ cached = Cache :: read ( $ cacheKey , CAKE_SETTINGS_APP_CACHE_KEY_AD_GROUP_MEMBER_MAIL ) ; if ( ! empty ( $ cached ) ) { return $ cached ; } $ conditions = '(&(userAccountControl:1.2.840.113556.1.4.803:=512)(!(useraccountcontrol:1.2.840.113556.1.4.803:=2))(objectClass=user)(' . CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MEMBER_OF . '=' . $ groupDn . '))' ; $ fields = [ CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_NAME , CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MAIL ] ; $ order = CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MAIL ; $ data = $ this -> find ( 'all' , compact ( 'conditions' , 'fields' , 'order' ) ) ; if ( empty ( $ data ) ) { return $ result ; } foreach ( $ data as $ dataItem ) { $ mail = Hash :: get ( $ dataItem , $ this -> alias . '.' . CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_MAIL ) ; $ name = Hash :: get ( $ dataItem , $ this -> alias . '.' . CAKE_SETTINGS_APP_LDAP_ATTRIBUTE_NAME ) ; if ( empty ( $ mail ) ) { continue ; } $ result [ $ mail ] = $ name ; } Cache :: write ( $ cacheKey , $ result , CAKE_SETTINGS_APP_CACHE_KEY_AD_GROUP_MEMBER_MAIL ) ; return $ result ; }
Return list of e-mail for users, that are members of a
security group in Active Directory.

@param string $groupDn Security group distinguished name.
@return array List of email addresses for the users who are
members of a security group in Active Directory.
Return list of e - mail for users that are members of a security group in Active Directory .