Show
Ignore:
Timestamp:
07/07/03 14:19:52 (21 years ago)
Author:
jalet
Message:

Now repykota and warnpykota --groups check the groups the user is a member of
in the print quota database, not in the system passwd/group files

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/warnpykota

    r1041 r1071  
    2323# 
    2424# $Log$ 
     25# Revision 1.21  2003/07/07 12:19:52  jalet 
     26# Now repykota and warnpykota --groups check the groups the user is a member of 
     27# in the print quota database, not in the system passwd/group files 
     28# 
    2529# Revision 1.20  2003/06/25 14:10:01  jalet 
    2630# Hey, it may work (edpykota --reset excepted) ! 
     
    173177            # protects other users from mail bombing if they are 
    174178            # over quota. 
     179            username = pwd.getpwuid(uid)[0] 
    175180            if options["groups"] : 
    176                 ugnames = [ grp.getgrgid(pwd.getpwuid(uid)[3])[0] ] 
     181                user = self.storage.getUser(username) 
     182                if user.Exists : 
     183                    ugnames = [ g.Name for g in self.storage.getUserGroups(user) ] 
     184                else :     
     185                    ugnames = [ ] 
    177186            else : 
    178                 ugnames = [ pwd.getpwuid(uid)[0] ] 
     187                ugnames = [ username ] 
    179188         
    180189        printers = self.storage.getMatchingPrinters(options["printer"])