disable dnsZoneEntry and privateSub for guest accounts
authorMartin Zobel-Helas <zobel@debian.org>
Fri, 8 Mar 2013 23:30:07 +0000 (00:30 +0100)
committerMartin Zobel-Helas <zobel@debian.org>
Fri, 8 Mar 2013 23:30:07 +0000 (00:30 +0100)
Signed-off-by: Martin Zobel-Helas <zobel@debian.org>
UDLdap.py
ud-generate

index 3c0f0ef..f19703f 100644 (file)
--- a/UDLdap.py
+++ b/UDLdap.py
@@ -87,6 +87,9 @@ class Account:
     def is_active_user(self):
         return self['accountStatus'] == 'active' and self.numkeys() != 0
 
+    def is_guest_account(self):
+        return self['gidNumber'] == 60000
+
     def latitude_dec(self, anonymized=False):
         return userdir_ldap.DecDegree(self['latitude'], anonymized)
     def longitude_dec(self, anonymized=False):
index 955757e..44bccc4 100755 (executable)
@@ -665,6 +665,7 @@ def GenPrivate(accounts, File):
       # Write out the position for each user
       for a in accounts:
          if not a.is_active_user(): continue
+         if a.is_guest_account(): continue
          if not 'privateSub' in a: continue
          try:
             Line = "%s"%(a['privateSub'])
@@ -778,6 +779,7 @@ def GenDNS(accounts, File):
       for a in accounts:
          if not 'dnsZoneEntry' in a: continue
          if not a.is_active_user() and not isRoleAccount(a): continue
+         if a.is_guest_account(): continue
 
          try:
             F.write("; %s\n"%(a.email_address()))