getDomainName() public method

Get the fully qualified domain name.
public getDomainName ( ) : string
return string
Exemplo n.º 1
0
 /**
  * Attempt to lookup the LDAP servers from the DNS name.
  *
  * @return array The LDAP servers.
  * @throws LdapConnectionException
  */
 protected function getServersFromDns()
 {
     $servers = $this->dns->getRecord(LdapUtilities::SRV_PREFIX . $this->config->getDomainName(), DNS_SRV);
     if ($servers === false || empty($servers)) {
         throw new LdapConnectionException(sprintf('No LDAP servers found via DNS for "%s".', $this->config->getDomainName()));
     }
     array_multisort(array_column($servers, 'pri'), SORT_ASC | SORT_NUMERIC, array_column($servers, 'weight'), SORT_DESC | SORT_NUMERIC, $servers);
     return array_column($servers, 'target');
 }
Exemplo n.º 2
0
 /**
  * Given the connection resource and the other required parameters, attempt the bind and return the result.
  *
  * @param string $username
  * @return string
  */
 public function getUsername($username)
 {
     $replacements = [$username, $this->config->getDomainName()];
     return preg_replace($this->params, $replacements, $this->bindFormat);
 }