ldapdao/plugins/auth/ldapdao/ldapdao.auth.php
protected function _bindLdapAdminUser()
    {
        $connect = $this->_getLinkId();
        if (!$connect) {
            jLog::log('ldapdao: impossible to connect to ldap', 'auth');
            return false;
        }

        if ($this->_params['adminUserDn'] == '') {
            $bind = ldap_bind($connect);
        } else {
            $bind = ldap_bind($connect, $this->_params['adminUserDn'], $this->_params['adminPassword']);
        }
        if (!$bind) {
            if ($this->_params['adminUserDn'] == '') {
                jLog::log('ldapdao: impossible to authenticate to ldap as anonymous admin user', 'auth');
            } else {
                jLog::log('ldapdao: impossible to authenticate to ldap with admin user '.$this->_params['adminUserDn'], 'auth');
            }
            ldap_close($connect);
            return false;
        }
        return $connect;
    }
protected function _bindLdapAdminUser()
    {
        $connect = $this->_getLinkId();
        if (!$connect) {
            jLog::log('ldapdao: impossible to connect to ldap', 'auth');
            return false;
        }

        if ($this->_params['adminUserDn'] == '') {
            $bind = ldap_bind($connect);
        } else {
            $bind = ldap_bind($connect, $this->_params['adminUserDn'], $this->_params['adminPassword']);
        }
        if (!$bind) {
            if ($this->_params['adminUserDn'] == '') {
                jLog::log('ldapdao: impossible to authenticate to ldap as anonymous admin user', 'auth');
            } else {
                jLog::log('ldapdao: impossible to authenticate to ldap with admin user '.$this->_params['adminUserDn'], 'auth');
            }
            ldap_close($connect);
            return false;
        }
        return $connect;
    }
protected function _bindLdapAdminUser ( ) { $ connect = $ this -> _getLinkId ( ) ; if ( ! $ connect ) { jLog :: log ( 'ldapdao: impossible to connect to ldap' , 'auth' ) ; return false ; } if ( $ this -> _params [ 'adminUserDn' ] == '' ) { $ bind = ldap_bind ( $ connect ) ; } else { $ bind = ldap_bind ( $ connect , $ this -> _params [ 'adminUserDn' ] , $ this -> _params [ 'adminPassword' ] ) ; } if ( ! $ bind ) { if ( $ this -> _params [ 'adminUserDn' ] == '' ) { jLog :: log ( 'ldapdao: impossible to authenticate to ldap as anonymous admin user' , 'auth' ) ; } else { jLog :: log ( 'ldapdao: impossible to authenticate to ldap with admin user ' . $ this -> _params [ 'adminUserDn' ] , 'auth' ) ; } ldap_close ( $ connect ) ; return false ; } return $ connect ; }
open the connection to the ldap server
and bind to the admin user
@return resource|false the ldap connection
open the connection to the ldap server and bind to the admin user