For more information about ldap have a look at
http://www.openldap.org/
It s a protocol that let you easily query and affect data in a tree structure.
It is ususally used to share common data for several authetification system (login,pop,database, whatever).
You can have your loggin authentifiaction use ldap and php may be able to read the same information (the initial trouble was php is not able to read /etc/shadow)
Another simple way would be to have a www-data readable copy of the shadow file, but i guess it would not be a good security issue.
By the way, ill intentionned people are often inside the organisation itself, so do not be too trustfull about intranet user.
Good luck