X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=ud-emailmatcher;h=b6e054d7c243e0953587b1a756097fca634f72a5;hb=71597847edb263c9837155db7ace4af5acce726e;hp=bae8fd9d6feeb1dcc3bb830cb1257d454a769957;hpb=7e02135e1259847ac592fc58a408452f2e9e41af;p=mirror%2Fuserdir-ldap.git diff --git a/ud-emailmatcher b/ud-emailmatcher index bae8fd9..b6e054d 100755 --- a/ud-emailmatcher +++ b/ud-emailmatcher @@ -52,8 +52,7 @@ for x in arguments: Args = Args + GPGSearchOptions + [" 2> /dev/null"] Keys = os.popen(" ".join(Args),"r") -l = ldap.open(LDAPServer); -l.simple_bind_s("",""); +l = connectLDAP() # Fetch the key list and map to email address PasswdAttrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"keyfingerprint=*",\ @@ -82,10 +81,10 @@ while(1): Split = Line.split(":") if len(Split) >= 8 and Split[0] == "pub": - if FingerPrint != None and UID != None: + if FingerPrint is not None and UID is not None: for x in Emails: Match = AddressSplit.match(x); - if Match == None: + if Match is None: continue; Groups = Match.groups(); Email = Groups[1]+'@'+Groups[2];