Changeset 1785 for pykota/trunk/bin

Show
Ignore:
Timestamp:
10/06/04 12:05:47 (20 years ago)
Author:
jalet
Message:

Minor changes to allow any PyKota administrator to launch enhanced versions
of the commands, and not only the root user.

Location:
pykota/trunk/bin
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/dumpykota

    r1779 r1785  
    2424# 
    2525# $Log$ 
     26# Revision 1.10  2004/10/06 10:05:47  jalet 
     27# Minor changes to allow any PyKota administrator to launch enhanced versions 
     28# of the commands, and not only the root user. 
     29# 
    2630# Revision 1.9  2004/10/05 20:08:46  jalet 
    2731# Misleading help message. Thx to Johannes Laemmermann. 
     
    149153    def main(self, arguments, options) : 
    150154        """Print Quota Data Dumper.""" 
     155        if not self.config.isAdmin : 
     156            raise PyKotaToolError, _("You're not allowed to dump PyKota's datas.") 
     157             
    151158        datatype = options["data"] 
    152159        if datatype not in [ "history", 
  • pykota/trunk/bin/pykosd

    r1608 r1785  
    2424# 
    2525# $Log$ 
     26# Revision 1.8  2004/10/06 10:05:47  jalet 
     27# Minor changes to allow any PyKota administrator to launch enhanced versions 
     28# of the commands, and not only the root user. 
     29# 
    2630# Revision 1.7  2004/07/20 22:42:26  jalet 
    2731# pykosd now supports setting color 
     
    141145        savecolor = color 
    142146         
    143         uid = os.geteuid() 
    144         uname = pwd.getpwuid(uid)[0] 
     147        uname = pwd.getpwuid(os.geteuid())[0] 
    145148        while 1 : 
    146149            color = savecolor 
  • pykota/trunk/bin/pykotme

    r1584 r1785  
    2424# 
    2525# $Log$ 
     26# Revision 1.14  2004/10/06 10:05:47  jalet 
     27# Minor changes to allow any PyKota administrator to launch enhanced versions 
     28# of the commands, and not only the root user. 
     29# 
    2630# Revision 1.13  2004/07/01 19:56:42  jalet 
    2731# Better dispatching of error messages 
     
    157161             
    158162        # get current user 
    159         uid = os.geteuid() 
    160         username = pwd.getpwuid(uid)[0] 
     163        username = pwd.getpwuid(os.geteuid())[0] 
    161164        user = self.storage.getUser(username) 
    162165        if user.Exists and user.LimitBy and (user.LimitBy.lower() == "balance"): 
  • pykota/trunk/bin/repykota

    r1546 r1785  
    2424# 
    2525# $Log$ 
     26# Revision 1.50  2004/10/06 10:05:47  jalet 
     27# Minor changes to allow any PyKota administrator to launch enhanced versions 
     28# of the commands, and not only the root user. 
     29# 
    2630# Revision 1.49  2004/06/18 13:34:49  jalet 
    2731# Now all tracebacks include PyKota's version number 
     
    239243  with "laser" or ends with "pson". 
    240244   
    241   If launched by a non-root user, additionnal arguments representing 
    242   users or groups names are ignored, and only the current user/group 
    243   is reported. 
     245  If launched by an user who is not a PyKota administrator, additionnal 
     246  arguments representing users or groups names are ignored, and only the 
     247  current user/group is reported. 
    244248 
    245249This program is free software; you can redistribute it and/or modify 
     
    263267    def main(self, ugnames, options) : 
    264268        """Print Quota reports generator.""" 
    265         uid = os.geteuid() 
    266         if not uid : 
    267             # root user 
     269        if self.config.isAdmin : 
     270            # PyKota administrator 
    268271            if not ugnames : 
    269272                # no username, means all usernames 
     
    272275            # not the root user 
    273276            # reports only the current user 
    274             username = pwd.getpwuid(uid)[0] 
     277            username = pwd.getpwuid(os.geteuid())[0] 
    275278            if options["groups"] : 
    276279                user = self.storage.getUser(username) 
  • pykota/trunk/bin/warnpykota

    r1546 r1785  
    2424# 
    2525# $Log$ 
     26# Revision 1.30  2004/10/06 10:05:47  jalet 
     27# Minor changes to allow any PyKota administrator to launch enhanced versions 
     28# of the commands, and not only the root user. 
     29# 
    2630# Revision 1.29  2004/06/18 13:34:49  jalet 
    2731# Now all tracebacks include PyKota's version number 
     
    171175  with "laserjet" 
    172176   
    173   If launched by a non-root user, additionnal arguments representing 
    174   users or groups names are ignored, and only the current user/group 
    175   is warned. 
     177  If launched by an user who is not a PyKota administrator, additionnal 
     178  arguments representing users or groups names are ignored, and only the 
     179  current user/group is reported. 
    176180 
    177181This program is free software; you can redistribute it and/or modify 
     
    195199    def main(self, ugnames, options) : 
    196200        """Warn users or groups over print quota.""" 
    197         uid = os.geteuid() 
    198         if not uid : 
    199             # root user 
     201        if self.config.isAdmin : 
     202            # PyKota administrator 
    200203            if not ugnames : 
    201204                # no username, means all usernames 
    202205                ugnames = [ "*" ] 
    203206        else :         
    204             # not the root user 
     207            # not a PyKota administrator 
    205208            # warns only the current user 
    206209            # the utility of this is discutable, but at least it 
    207210            # protects other users from mail bombing if they are 
    208211            # over quota. 
    209             username = pwd.getpwuid(uid)[0] 
     212            username = pwd.getpwuid(os.geteuid())[0] 
    210213            if options["groups"] : 
    211214                user = self.storage.getUser(username)