You are here

function LDAPInterface::connectAndBind in LDAP integration 5

Same name and namespace in other branches
  1. 5.2 ldap_integration/LDAPInterface.php \LDAPInterface::connectAndBind()
  2. 6 includes/LDAPInterface.inc \LDAPInterface::connectAndBind()
1 call to LDAPInterface::connectAndBind()
LDAPInterface::connect in ldap_integration/LDAPInterface.php

File

ldap_integration/LDAPInterface.php, line 133

Class

LDAPInterface

Code

function connectAndBind($dn = '', $pass = '') {
  $this
    ->initConnection();
  $con = $this->connection;
  if (!$this
    ->bind($dn, $pass)) {
    watchdog('user', t('LDAP Bind failure for user %user. Error %errno: %error', array(
      '%user' => $dn,
      '%errno' => ldap_errno($con),
      '%error' => ldap_error($con),
    )));
    return NULL;
  }
  return $con;
}