LdapTools\Connection\BindUserStrategy::getUsername PHP Method

getUsername() public method

Given the connection resource and the other required parameters, attempt the bind and return the result.
public getUsername ( string $username ) : string
$username string
return string
    public function getUsername($username)
    {
        $replacements = [$username, $this->config->getDomainName()];
        return preg_replace($this->params, $replacements, $this->bindFormat);
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function connect($username = null, $password = null, $anonymous = false, $server = null)
 {
     $this->initiateLdapConnection($server);
     $username = $this->usernameFormatter->getUsername($username ?: $this->config->getUsername());
     $password = $password ?: $this->config->getPassword();
     $this->bind($username, $password, $anonymous);
     $this->lastActivity = new \DateTime();
     return $this;
 }
All Usage Examples Of LdapTools\Connection\BindUserStrategy::getUsername