/** * {@inheritdoc} */ public function bindAsAdministrator() { $username = $this->configuration->getAdminUsername(); $password = $this->configuration->getAdminPassword(); $suffix = $this->configuration->getAdminAccountSuffix(); $this->bindUsingCredentials($username, $password, $suffix); }
/** * {@inheritdoc} */ public function bindAsAdministrator() { $username = $this->configuration->getAdminUsername(); $password = $this->configuration->getAdminPassword(); $suffix = $this->configuration->getAdminAccountSuffix(); if (empty($suffix)) { // Use the user account suffix if no administrator account suffix is given. $suffix = $this->configuration->getAccountSuffix(); } $this->bindUsingCredentials($username, $password, $suffix); }
/** * Binds to the LDAP server as the configured administrator. * * @throws AdldapException * * @return bool */ protected function bindAsAdministrator() { $adminUsername = $this->configuration->getAdminUsername(); $adminPassword = $this->configuration->getAdminPassword(); $adminSuffix = $this->configuration->getAdminAccountSuffix(); if (empty($adminSuffix)) { // If the admin suffix is empty, we'll use the default account suffix. $adminSuffix = $this->configuration->getAccountSuffix(); } $this->bindUsingCredentials($adminUsername, $adminPassword, $adminSuffix); if ($this->connection->isBound() === false) { $error = $this->connection->getLastError(); throw new AdldapException("Rebind to Active Directory failed. AD said: {$error}"); } return true; }