I get this error always
Server is unwilling to perform
and my code is the next:
echo "Checking ...";
$username = $_POST["username"];
$passwd = $_POST["passwd"];
$host = 'myhost.co.uk';
$port = 389;
$dn = 'uid='.$username.',cn=nssproxy,ou=users,dc=co,dc=uk';
// conexion a ldap
$conn = ldap_connect( "ldap://".$host.":389") ;
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($conn, LDAP_OPT_REFERRALS, 0);
// match de usuario y password
$bind = ldap_bind( $conn, $dn, $password );
if ($bind){
echo "OK";
}
else {
echo "NO OK";
}
echo ldap_error($conn);
Why I have this error? I'm always testing with any user, this script return same error.
Thanks in advance.