Changeset 1071

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

Location:
pykota/trunk/bin
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/repykota

    r1048 r1071  
    2323# 
    2424# $Log$ 
     25# Revision 1.41  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.40  2003/06/30 12:46:15  jalet 
    2630# Extracted reporting code. 
     
    238242            # not the root user 
    239243            # reports only the current user 
     244            username = pwd.getpwuid(uid)[0] 
    240245            if options["groups"] : 
    241                 ugnames = [ grp.getgrgid(pwd.getpwuid(uid)[3])[0] ] 
     246                user = self.storage.getUser(username) 
     247                if user.Exists : 
     248                    ugnames = [ g.Name for g in self.storage.getUserGroups(user) ] 
     249                else :     
     250                    ugnames = [ ] 
    242251            else : 
    243                 ugnames = [ pwd.getpwuid(uid)[0] ] 
     252                ugnames = [ username ] 
    244253         
    245254        printers = self.storage.getMatchingPrinters(options["printer"]) 
  • 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"])