PHP code to authentication against Active Directory for use with apache mod-auth-external