Add support for this attribute in ud-info taking into account that
[mirror/userdir-ldap.git] / userdir_ldap.py
index 4477232..babfce0 100644 (file)
@@ -43,6 +43,7 @@ TemplatesDir = ConfModule.templatesdir;
 PassDir = ConfModule.passdir;
 Ech_ErrorLog = ConfModule.ech_errorlog;
 Ech_MainLog = ConfModule.ech_mainlog;
+HostDomain = getattr(ConfModule, "hostdomain", EmailAppend)
 
 try:
    UseSSL = ConfModule.usessl;
@@ -320,7 +321,7 @@ def FormatPGPKey(Str):
    if (len(Str) == 32):
       I = 0;
       while (I < len(Str)):
-         if I+2 == 32/2:
+         if I == 32/2:
             Res = "%s %s%s "%(Res,Str[I],Str[I+1]);
          else:
             Res = "%s%s%s "%(Res,Str[I],Str[I+1]);
@@ -329,7 +330,7 @@ def FormatPGPKey(Str):
       # OpenPGP Print
       I = 0;
       while (I < len(Str)):
-         if I+4 == 40/2:
+         if I == 40/2:
             Res = "%s %s%s%s%s "%(Res,Str[I],Str[I+1],Str[I+2],Str[I+3]);
          else:
             Res = "%s%s%s%s%s "%(Res,Str[I],Str[I+1],Str[I+2],Str[I+3]);