I'm trying to get the LDAP to work..but it keeps giving me this error:
Code: Select all
phpMyFAQ warning [2]: ldap_search(): Search: Operations error in C:\www\phpmyfaq\inc\PMF\Ldap.php on line 274Here is my LDAP config:
Code: Select all
$PMF_LDAP['ldap_server'] = 'ldapserver.domain';
$PMF_LDAP['ldap_port'] = 389;
$PMF_LDAP['ldap_user'] = '';
$PMF_LDAP['ldap_password'] = '';
$PMF_LDAP['ldap_base'] = 'dc=ad,dc=int';
$PMF_LDAP['ldap_use_domain_prefix'] = false;
$PMF_LDAP['ldap_use_anonymous_login'] = true;
I have LDAP working on my home made php script but not PHPMYFAQ (below is what works from my script):
Code: Select all
$adServer = "ldapserver.domain";
$port = 389;
$ldap = ldap_connect($adServer, $port);
$username = $_POST['username'];
$password = $_POST['password'];
$ldaprdn = 'ad' . "\\" . $username;
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
$bind = @ldap_bind($ldap, $ldaprdn, $password);
if ($bind) {
$filter="(sAMAccountName=$username)";
$result = ldap_search($ldap,"dc=ad,dc=int",$filter);
echo "Success";
} else {
echo "Login failed";
}