Copying content from https://github.com/fintanmm/pam-ldap-formula