X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-mailgate;h=60baacdc2b12433de6030a31f7c68c14d155a5d1;hb=94daca1054ff149228a914e095739433deb6e175;hp=2d8ce8c6e759a21af6b0c784ae773d9d8ac4e282;hpb=d3d5dd5a3fc470f834f5f021cf86ebfede644fcf;p=mirror%2Fuserdir-ldap.git diff --git a/ud-mailgate b/ud-mailgate index 2d8ce8c..60baacd 100755 --- a/ud-mailgate +++ b/ud-mailgate @@ -344,8 +344,8 @@ def HandleChange(Reply,DnRecord,Key): # Modify the record l.simple_bind_s("uid="+AccessPass[0]+","+BaseDn,AccessPass[1]); oldAttrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"uid="+GetAttr(DnRecord,"uid")); - if (string.find(GetAttr(oldAttrs[0],"userPassword"),"*LK*") != -1) \ - or GetAttr(x,"userPassword").startswith("!"): + if ((string.find(GetAttr(oldAttrs[0],"userPassword"),"*LK*") != -1) + or GetAttr(oldAttrs[0],"userPassword").startswith("!")): raise Error, "This account is locked"; Dn = "uid=" + GetAttr(DnRecord,"uid") + "," + BaseDn; l.modify_s(Dn,Attrs); @@ -416,7 +416,7 @@ def HandleChPass(Reply,DnRecord,Key): # Check for a locked account Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"uid="+GetAttr(DnRecord,"uid")); if (string.find(GetAttr(Attrs[0],"userPassword"),"*LK*") != -1) \ - or GetAttr(x,"userPassword").startswith("!"): + or GetAttr(Attrs[0],"userPassword").startswith("!"): raise Error, "This account is locked"; # Modify the password