Welcome Guest, Not a member yet? Register   Sign In
New LDAP Library!
#21

[eluser]Iverson[/eluser]
[quote author="sidog" date="1231901395"]Hey Iverson,

Glad you didn't take my suggestion for a more grammatically correct example comment too hard. There are probably people that would have feelings of hurt and anger if someone pointed out that their English language skills may not be as strong as their PHP language skills.

At any rate, I will use your suggestions and links and try to work out a fix. Thank you


P.S. Sorry, I'm just very frustrated with this ldap stuff. I'm very grateful that you took the time to release and support such a badly needed library.[/quote]

Well when you're asking for help, the last thing you want to do is being a wisea** to the person/people you're asking for help from. My whole point was that--as I had to point out a few replies above this one--don't just take code and expect to throw it in without at least reading through a little bit and understanding how it Works. Quite frankly, if someone doesn't understand that a server name has to be defined in order for their Ldap connection to work, then they need to take a step back before they take a stab at implementing PHP and AD. Hope it works.
#22

[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.

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 declaration 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.
#23

[eluser]jcavard[/eluser]
[quote author="sidog" date="1231974364"]
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 declaration is zeroing it out?)
[/quote]

The domain_controllers var is set to array() when the class is instanciated. Try something like, and it works fine.
Code:
$this->load->library('ldap', array("domain_controllers" => array(LDAP_SERVER1)));

However, I do have a question myself. Is there a way to know if the connection is made correctly? At this time, I put whatever I want in LDAP_SERVER1, and I don't get any error. When I type in the AD address, it still doesnt authenticate though.. is there a way to isolate what I'm doing wrong. I am suppôsedly using the right credentials, but still can't get any information from the LDAP, anyone?
#24

[eluser]Iverson[/eluser]
I always verified my LDAP connectivity by simply using the PHP's native LDAP functions. Try that first. If that works, then it's the lib. If not, then the answer's obvious.
#25

[eluser]jcavard[/eluser]
That's what I tried first, but even that code never returns any error
Code:
// LDAP variables
$ldaphost = "i:type-whatever-in_here";  // LDAP server

// LDAP connection
$ldapconn = ldap_connect($ldaphost) or die("Impossible de se connecter au serveur LDAP $ldaphost");
print_r($ldapconn);
}
This always returns 'Resource id #23'

I followed the procedure you gave for installing php_ldap.dll. I am stunned right now, really. Thanks for the quick reply though, and that lib is kick ass! Just need to figure out that last thingy...
#26

[eluser]Unknown[/eluser]
hello, this sounds like a great piece of work! Smile
unfortunately the download link is broken.
any alternative perhaps ?

ty in advance.
#27

[eluser]jcavard[/eluser]
[quote author="jcavard" date="1233008373"]That's what I tried first, but even that code never returns any error
Code:
// LDAP variables
$ldaphost = "i:type-whatever-in_here";  // LDAP server

// LDAP connection
$ldapconn = ldap_connect($ldaphost) or die("Impossible de se connecter au serveur LDAP $ldaphost");
print_r($ldapconn);
}
This always returns 'Resource id #23'

I followed the procedure you gave for installing php_ldap.dll. I am stunned right now, really. Thanks for the quick reply though, and that lib is kick ass! Just need to figure out that last thingy...[/quote]

Well, I sorta found out what was wrong. I used phpLDAPadmin to connect to our LDAP, and then I been able to retreive the information I needed, in my case it was the BaseDN.

Thanks a lot Iverson. Brilliant work!
#28

[eluser]Ener1[/eluser]
Hello this looks really nice but I can´t download it please can you fix the download
#29

[eluser]Iverson[/eluser]
[quote author="Ener1" date="1233889361"]Hello this looks really nice but I can´t download it please can you fix the download[/quote]

The link is back up.
#30

[eluser]Ener1[/eluser]
wow thanks a lot!!!!!!!!!!!!!




Theme © iAndrew 2016 - Forum software by © MyBB