config through constructor
This commit is contained in:
parent
cd40a5cfe1
commit
f8ce7115a1
15
getmailad.py
15
getmailad.py
|
@ -2,21 +2,20 @@
|
|||
|
||||
class getmailad(object):
|
||||
|
||||
""" get all email addresses from enabled(not disabled)
|
||||
""" get all email addresses from enabled
|
||||
users/groups from active directory """
|
||||
|
||||
""" tested with windows 2003 domain """
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, ldap_server, bind_dn, bind_pass, base_dn):
|
||||
|
||||
self.addresslist = []
|
||||
self.count = 0
|
||||
|
||||
#TODO: make this configurable via constructor
|
||||
self._ldap_server = "ldap://dc2.aec.at"
|
||||
self._bind_dn = "david@aec.at"
|
||||
self._bind_pass = "xxxxxxx"
|
||||
self._base_dn = "ou=adm,dc=aec,dc=at"
|
||||
self._ldap_server = ldap_server
|
||||
self._bind_dn = bind_dn
|
||||
self._bind_pass = bind_pass
|
||||
self._base_dn = base_dn
|
||||
|
||||
|
||||
def get(self):
|
||||
|
@ -58,7 +57,7 @@ class getmailad(object):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
getmailadobj = getmailad()
|
||||
getmailadobj = getmailad("ldap://dc2.aec.at", "davidsa@aec.at", "secret", "ou=adm,dc=aec,dc=at")
|
||||
getmailadobj.get()
|
||||
for item in getmailadobj.addresslist:
|
||||
print item
|
||||
|
|
Loading…
Reference in New Issue