Code: Select all
PHP Warning: ldap_bind() [<a href='function.ldap-bind'>function.ldap-bind</a>]: Unable to bind to server: Invalid credentials in xxxx
on line 242Code: Select all
/* LDAP Code begin */
public function ldapAuthentication($username, $password) {
$ldap = array('ldaphost' => 'ldap://ldap.domain.com',
'domain' => 'domain.com',
'dn' => 'ou=Users,dc=domain,dc=com',
'binduser' => 'CN=Proxy,ou=Users,dc=domain,dc=com',
'bindpass' => 'proxypassword'
);
// Open LDAP connection to server
$ldapconn = ldap_connect($ldap['ldaphost']);
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);
// Bind with binduser as proxy to do the search
[b]$proxyBind = ldap_bind($ldapconn, $ldap['binduser'], $ldap['bindpass'])[/b]
All I want to do is to be able to log into Gallery2 with ldap. I'm starting to pull my hair out over this. Obviously in this example ive taken out my ldap details. I've had them checked and i've definately put in the right details. Can anyone see anything obviously wrong in the code?
The full code is located at http://codex.gallery2.org/LDAP_authentication under LDAP UserLogin for Gallery 2.3.