require('password.php3'); if ($action == 'checkpass'){ $ds=@ldap_connect("$config[ldap_server]"); // must be a valid ldap server! if ($ds){ if ($dn != ''){ if ($passwd == '') $passwd = 'not_exist'; $r = @ldap_bind($ds,$dn,$passwd); if ($r) $msg = 'YES It is that'; else $msg = 'NO It is wrong'; } else $msg = 'User DN is not available. Check your configuration'; @ldap_close($ds); } else $msg = 'Could not connect to LDAP server'; echo "$msg\n"; } ?>