Changeset 1785 for pykota/trunk
- Timestamp:
- 10/06/04 12:05:47 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 8 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/dumpykota
r1779 r1785 24 24 # 25 25 # $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 # 26 30 # Revision 1.9 2004/10/05 20:08:46 jalet 27 31 # Misleading help message. Thx to Johannes Laemmermann. … … 149 153 def main(self, arguments, options) : 150 154 """Print Quota Data Dumper.""" 155 if not self.config.isAdmin : 156 raise PyKotaToolError, _("You're not allowed to dump PyKota's datas.") 157 151 158 datatype = options["data"] 152 159 if datatype not in [ "history", -
pykota/trunk/bin/pykosd
r1608 r1785 24 24 # 25 25 # $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 # 26 30 # Revision 1.7 2004/07/20 22:42:26 jalet 27 31 # pykosd now supports setting color … … 141 145 savecolor = color 142 146 143 uid = os.geteuid() 144 uname = pwd.getpwuid(uid)[0] 147 uname = pwd.getpwuid(os.geteuid())[0] 145 148 while 1 : 146 149 color = savecolor -
pykota/trunk/bin/pykotme
r1584 r1785 24 24 # 25 25 # $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 # 26 30 # Revision 1.13 2004/07/01 19:56:42 jalet 27 31 # Better dispatching of error messages … … 157 161 158 162 # get current user 159 uid = os.geteuid() 160 username = pwd.getpwuid(uid)[0] 163 username = pwd.getpwuid(os.geteuid())[0] 161 164 user = self.storage.getUser(username) 162 165 if user.Exists and user.LimitBy and (user.LimitBy.lower() == "balance"): -
pykota/trunk/bin/repykota
r1546 r1785 24 24 # 25 25 # $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 # 26 30 # Revision 1.49 2004/06/18 13:34:49 jalet 27 31 # Now all tracebacks include PyKota's version number … … 239 243 with "laser" or ends with "pson". 240 244 241 If launched by a non-root user, additionnal arguments representing242 users or groups names are ignored, and only the current user/group243 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. 244 248 245 249 This program is free software; you can redistribute it and/or modify … … 263 267 def main(self, ugnames, options) : 264 268 """Print Quota reports generator.""" 265 uid = os.geteuid() 266 if not uid : 267 # root user 269 if self.config.isAdmin : 270 # PyKota administrator 268 271 if not ugnames : 269 272 # no username, means all usernames … … 272 275 # not the root user 273 276 # reports only the current user 274 username = pwd.getpwuid( uid)[0]277 username = pwd.getpwuid(os.geteuid())[0] 275 278 if options["groups"] : 276 279 user = self.storage.getUser(username) -
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) -
pykota/trunk/NEWS
r1774 r1785 22 22 PyKota NEWS : 23 23 24 - 1.20alpha21 : 25 26 - Now dumpykota refuses to launch if the current user is not 27 a PyKota administrator (a PyKota administrator is an user 28 allowed to read the pykotadmin.conf file). 29 30 - Now any PyKota administrator can use repykota and warnpykota 31 with additionnal arguments, not only the root user. 32 33 - Improved documentation a bit. 34 24 35 - 1.20alpha20 : 25 36 -
pykota/trunk/pykota/config.py
r1757 r1785 22 22 # 23 23 # $Log$ 24 # Revision 1.53 2004/10/06 10:05:47 jalet 25 # Minor changes to allow any PyKota administrator to launch enhanced versions 26 # of the commands, and not only the root user. 27 # 24 28 # Revision 1.52 2004/09/29 20:20:52 jalet 25 29 # Added the winbind_separator directive to pykota.conf to allow the admin to … … 237 241 def __init__(self, directory) : 238 242 """Reads and checks the configuration file.""" 243 self.isAdmin = 0 244 self.directory = directory 239 245 self.filename = os.path.join(directory, "pykota.conf") 240 246 if not os.path.isfile(self.filename) : … … 286 292 backendinfo["storageadminpw"] = None 287 293 adminconf = ConfigParser.ConfigParser() 288 adminconf.read(["/etc/pykota/pykotadmin.conf"]) 294 filename = os.path.join(self.directory, "pykotadmin.conf") 295 adminconf.read([filename]) 289 296 if adminconf.sections() : # were we able to read the file ? 290 297 try : 291 298 backendinfo["storageadmin"] = adminconf.get("global", "storageadmin", raw=1) 292 299 except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) : 293 raise PyKotaConfigError, _("Option %s not found in section global of %s") % ("storageadmin", "/etc/pykota/pykotadmin.conf") 300 raise PyKotaConfigError, _("Option %s not found in section global of %s") % ("storageadmin", filename) 301 else : 302 self.isAdmin = 1 # We are a PyKota administrator 294 303 try : 295 304 backendinfo["storageadminpw"] = adminconf.get("global", "storageadminpw", raw=1) -
pykota/trunk/pykota/version.py
r1771 r1785 22 22 # 23 23 24 __version__ = "1.20alpha2 0_unofficial"24 __version__ = "1.20alpha21_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""