Changeset 1785 for pykota/trunk/bin/warnpykota
- Timestamp:
- 10/06/04 12:05:47 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/warnpykota
r1546 r1785 24 24 # 25 25 # $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 # 26 30 # Revision 1.29 2004/06/18 13:34:49 jalet 27 31 # Now all tracebacks include PyKota's version number … … 171 175 with "laserjet" 172 176 173 If launched by a non-root user, additionnal arguments representing174 users or groups names are ignored, and only the current user/group175 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. 176 180 177 181 This program is free software; you can redistribute it and/or modify … … 195 199 def main(self, ugnames, options) : 196 200 """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 200 203 if not ugnames : 201 204 # no username, means all usernames 202 205 ugnames = [ "*" ] 203 206 else : 204 # not the root user207 # not a PyKota administrator 205 208 # warns only the current user 206 209 # the utility of this is discutable, but at least it 207 210 # protects other users from mail bombing if they are 208 211 # over quota. 209 username = pwd.getpwuid( uid)[0]212 username = pwd.getpwuid(os.geteuid())[0] 210 213 if options["groups"] : 211 214 user = self.storage.getUser(username)