Next / Previous / Contents / TCC Help System / NM Tech homepage

12. genWebUsers(): Find users with homepages

# - - -   g e n W e b U s e r s

def genWebUsers():
    '''Find all users with personal pages.

      [ generate WebUser instances representing all users in
        LDAP_SERVER who have a readable WEB_DIR subdirectory ]

The logic that queries the LDAP server for user accounts is Section 13, “genAllUsers(): Find all the users in LDAP”. The logic that checks to see if a given user has a personal Web page is Section 14, “isWebUser(): Does this user have a personal Web?”.

    #-- 1 --
    for webUser in genAllUsers():
        if isWebUser(webUser):
            yield webUser

    #-- 2 --
    raise StopIteration