/** * Prepares the connection by setting configured parameters. * * @return void */ protected function prepareConnection() { if ($this->configuration->get('use_ssl')) { $this->connection->ssl(); } elseif ($this->configuration->get('use_tls')) { $this->connection->tls(); } $this->connection->setOptions([LDAP_OPT_PROTOCOL_VERSION => $this->configuration->get('version'), LDAP_OPT_NETWORK_TIMEOUT => $this->configuration->get('timeout'), LDAP_OPT_REFERRALS => $this->configuration->get('follow_referrals')]); }
/** * {@inheritdoc} */ public function bindAsAdministrator() { $credentials = [$this->configuration->get('admin_username'), $this->configuration->get('admin_password'), $this->configuration->get('admin_account_prefix'), $this->configuration->get('admin_account_suffix')]; list($username, $password, $prefix, $suffix) = array_pad($credentials, 4, null); $this->bind($username, $password, $prefix, $suffix); }