I am stuck with LDAP authentication using in PHP...googled lot of forums, read lot of articles, without success. May somebody knows the solution..
So, first, I have a working solution thru apache htaccess as a start
AuthName "Restricted area"
AuthType Basic
AuthBasicProvider ldap
AuthLDAPURL "ldap://servername.ac.uk:389/ou=ooooo,dc=myusers,dc=mmm,dc=nnn,dc=ooo?cn?sub?(objectClass=person)"
AuthLDAPBindDN "cn=tttt,ou=Users,dc=myusers,dc=mmm,dc=nnn,dc=ooo"
AuthLDAPBindPassword "xxxxxxx"
# Must be in one of these groups to access the web pages:
require ldap-group CN=staff1,OU=Group1,DC= myusers,DC= mmm,DC= nnn,DC= ooo
require ldap-group CN=staff2,OU=Group2,DC= myusers,DC= mmm,DC= nnn,DC= ooo
that htaccess succcesfuly checks an user belongs to a group and authenticates him.
However, I would like to convert it to PHP but don't have much knowledge about LDAP so don't know how to convert it into php code?
Thanks in advance.