Welcome Guest, Not a member yet? Register   Sign In
problem
#1

[eluser]sidog[/eluser]
Quote:The example I provided in the user guide shows that you have to specify domain controllers. I would expect you to get an error if you didn’t tell the lib what domain controllers to use.


Code:
// This library is loaded using the following code:
$this->load->library('ldap');

// The constant "LDAP_SERVER1" has been defined in config/constants.php
// define ('LDAP_SERVER1', 'www.example.com');
// define ('LDAP_SERVER2', 'ww2.example.com');

$this->ldap->_domain_controllers = array(LDAP_SERVER1, LDAP_SERVER2);
if($this->ldap->authenticate($username,$password))
{
     echo '<pre>' .print_r($this->ldap->user_info($username), TRUE) . '</pre>';
}



The example above shows the ldap server 1 and 2 being defined _after_ the library is loaded (which gives and error). I tried this:



Code:
// Define and set domain controllers in the object
define ('LDAP_SERVER1', 'www.example.com');
define ('LDAP_SERVER2', 'ww2.example.com');
$this->ldap->_domain_controllers = array(LDAP_SERVER1, LDAP_SERVER2);

// Load library
$this->load->library('ldap');


if($this->ldap->authenticate($username,$password))
{
     echo '<pre>' .print_r($this->ldap->user_info($username), TRUE) . '</pre>';
}


Still didn't work. I printed out the object from within the library and found that the domain controller array is empty. (maybe the var statement is zeroing it out?)

I manually set the var declarations for "_domain_controllers", "_ad_username" and "_ad_password" with my server specific details. I'm getting a "FATAL: AD bind failed. Check the login credentials." error.

I'm think the _base_dn is the culprit now and will explore it further tomorrow.




Theme © iAndrew 2016 - Forum software by © MyBB