190 | | # Update the quota for the previous user on this printer according |
191 | | # to the job size (difference between actual counter and latest one from storage) |
| 195 | # if the internal lifetime page counter for this printer is 0 |
| 196 | # then this may be a printer with a volatile counter (never |
| 197 | # saved to NVRAM) which has just been switched off and then on |
| 198 | # so we use the last page counter from the Quota Storage instead |
| 199 | # explanation at : http://web.mit.edu/source/third/lprng/doc/LPRng-HOWTO-15.html |
| 200 | if counterbeforejob == 0 : |
| 201 | counterbeforejob = lastpagecounter |
| 202 | |
| 203 | # Computes the last job size as the difference between internal page |
| 204 | # counter in the printer and last page counter taken from the Quota |
| 205 | # Storage database for this particular printer |
193 | | if jobsize >= 0 : |
194 | | kotafilter.storage.updateUserPQuota(lastuserid, printerid, jobsize) |
195 | | kotafilter.storage.updateJobSizeInHistory(lasthistoryid, jobsize) |
196 | | kotafilter.warnUserPQuota(lastusername) |
197 | | else : |
| 207 | if jobsize < 0 : |
| 208 | # Probably an HP printer which was switched off and back on, |
| 209 | # its primary counter is only saved in a 10 increment, so |
| 210 | # it may be lower than the last page counter saved in the |
| 211 | # Quota Storage, we take the absolute value of the difference |
| 212 | # this should take care of the "missing" pages. |
| 213 | # explanation at : http://web.mit.edu/source/third/lprng/doc/LPRng-HOWTO-15.html |