1
1
Fork 0

config through constructor

This commit is contained in:
David 2012-07-03 11:33:40 +02:00
parent cd40a5cfe1
commit f8ce7115a1
1 changed files with 7 additions and 8 deletions

View File

@ -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