Changeset 2232
- Timestamp:
- 05/05/05 23:52:49 (19 years ago)
- Location:
- pykota/trunk
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pykosd
r2216 r2232 117 117 savecolor = color 118 118 119 uname = pwd.getpwuid(os.get euid())[0]119 uname = pwd.getpwuid(os.getuid())[0] 120 120 while 1 : 121 121 color = savecolor -
pykota/trunk/bin/pykotme
r2216 r2232 104 104 self.printInfo(msg) 105 105 106 # get current user 107 username = pwd.getpwuid(os.geteuid())[0] 106 printers = self.storage.getMatchingPrinters(options["printer"]) 107 if not printers : 108 raise PyKotaToolError, _("There's no printer matching %s") % options["printer"] 109 110 username = pwd.getpwuid(os.getuid())[0] 108 111 user = self.storage.getUser(username) 109 112 if user.Exists and user.LimitBy and (user.LimitBy.lower() == "balance"): 110 113 print _("Your account balance : %.2f") % (user.AccountBalance or 0.0) 111 114 112 printers = self.storage.getMatchingPrinters(options["printer"])113 if not printers :114 raise PyKotaToolError, _("There's no printer matching %s") % options["printer"]115 116 115 print _("Job size : %i pages") % totalsize 117 for printer in printers : 118 userpquota = self.storage.getUserPQuota(user, printer) 119 cost = userpquota.computeJobPrice(totalsize) 120 print _("Cost on printer %s : %.2f") % (printer.Name, cost) 116 if user.Exists : 117 for printer in printers : 118 userpquota = self.storage.getUserPQuota(user, printer) 119 if userpquota.Exists : 120 cost = userpquota.computeJobPrice(totalsize) 121 print _("Cost on printer %s : %.2f") % (printer.Name, cost) 121 122 122 123 if __name__ == "__main__" : -
pykota/trunk/cgi-bin/pykotme.cgi
r2229 r2232 145 145 try : 146 146 user = self.storage.getUser(remuser) 147 for printer in printers : 148 upquota = self.storage.getUserPQuota(user, printer) 149 cost = upquota.computeJobPrice(jobsize) 150 self.body += "<p>%s</p>" % (_("Cost on printer %s : %.2f") % (printer.Name, cost)) 147 if user.Exists : 148 for printer in printers : 149 upquota = self.storage.getUserPQuota(user, printer) 150 if upquota.Exists : 151 cost = upquota.computeJobPrice(jobsize) 152 self.body += "<p>%s</p>" % (_("Cost on printer %s : %.2f") % (printer.Name, cost)) 151 153 except : 152 154 self.body += '<p><font color="red">%s</font></p>' % self.crashed("CGI Error").replace("\n", "<br />") -
pykota/trunk/cgi-bin/README
r2153 r2232 25 25 Be sure to restrict access to these CGI scripts as necessary. 26 26 27 For now, pykotme.cgi doesn't need any restriction.28 29 27 If you protect access to printquota.cgi or dumpykota.cgi with 30 28 username+password authentication, the REMOTE_USER CGI environment variable … … 35 33 If no username+password authentication takes place, then access 36 34 is completely unrestricted. 35 36 If you don't protect access to pykotme.cgi with username+password 37 authentication, then only the job's size will be displayed 38 to you. This is due to the cost of a print job on a particular printer 39 depending on the user because of the overcharging factor's value. 40 So if you want pykotme.cgi to produce complete web quotes, you must 41 ensure that the user logs in from his web browser whenever he uses 42 this CGI script. 37 43 38 44 You must ensure that the user your web server runs as can read -
pykota/trunk/NEWS
r2229 r2232 24 24 - 1.22beta : 25 25 26 - Improved stability in pykotme and pykotme.cgi. 27 28 - Fixed a permission problem in pykotme and pykosd. 29 26 30 - Fixed an inconsitency between SQL and LDAP backends' 27 31 behavior in edpykota.