Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c023bf78ea
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (14 sloc) 0.813 kb
module LDAPAttributes where
import LDAP
import Data.Maybe
first ldapEntries = ldapEntries !! 0
ldapAttrs (LDAPEntry {leattrs = attrs}) = attrs
-- Wrappers that simultaenously provide for LDAP attribute element retrieval
-- and deal with cases of non-existant elements gracefully
names ldapEntry = fromMaybe [] $ lookup "cn" $ ldapAttrs ldapEntry
cellphones ldapEntry = fromMaybe [] $ lookup "cellPhone" $ ldapAttrs ldapEntry
homephones ldapEntry = fromMaybe [] $ lookup "homePhone" $ ldapAttrs ldapEntry
emails ldapEntry = fromMaybe [] $ lookup "mail" $ ldapAttrs ldapEntry
aims ldapEntry = fromMaybe [] $ lookup "aolScreenName" $ ldapAttrs ldapEntry
sn ldapEntry = fromMaybe [] $ lookup "sn" $ ldapAttrs ldapEntry
justAttr attr strMap = first $ fromJust $ lookup attr strMap
Jump to Line
Something went wrong with that request. Please try again.