Hello,
I want to set up an intranet site where user log in with their Active Directory username and password using LDAP.
I have Appserv 2.5.7 running on my machine (windows xp SP2):
# Apache Web Server Version 2.2.3
# PHP Script Language Version 5.1.6
# MySQL Database Version 5.0.24a
# phpMyAdmin Database Manager Version 2.9.0.2
We have an exchange 2003 server with ldap.
I use the following script to let users log in:
<?php
$ldap['host'] = '192.168.1.2';
$ldap['port'] = 389;
function ldap_authenticate($username, $password) {
global $ldap;
$conn = ldap_connect($ldap['host'],$ldap['port']);
if ($conn) {
if (ldap_bind( $conn, $username, $password) ) {
ldap_close($conn);
return TRUE;
}
}
ldap_close($conn);
return FALSE;
}
if (!ldap_authenticate('user@domain.local', 'pass')) {
echo 'Authorization Failed';
} else {
echo 'Welcome';
}
?>
When i use this code, i get the following:
Call to undefined function ldap_connect()
Appserv has ldap-support and i have uncommentet "extension=php_ldap.dll" in the php.ini file but still no result.
Can anybody help me?