Changeset 1519

Show
Ignore:
Timestamp:
06/04/04 00:12:53 (20 years ago)
Author:
jalet
Message:

Now denies empty jobs

Location:
pykota/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1517 r1519  
    2424# 
    2525# $Log$ 
     26# Revision 1.59  2004/06/03 22:12:53  jalet 
     27# Now denies empty jobs 
     28# 
    2629# Revision 1.58  2004/06/03 21:50:33  jalet 
    2730# Improved error logging. 
     
    340343            os.environ["PYKOTAPHASE"] = "BEFORE" 
    341344             
    342             # checks the user's quota 
     345            # do we want strict or laxist quota enforcement ? 
    343346            if self.config.getPrinterEnforcement(printer.Name) == "STRICT" : 
    344347                self.softwareJobSize = self.precomputeJobSize() 
     
    347350            os.environ["PYKOTAPRECOMPUTEDJOBSIZE"] = str(self.softwareJobSize) 
    348351            os.environ["PYKOTAPRECOMPUTEDJOBPRICE"] = str(self.softwareJobPrice) 
     352             
     353            # checks the user's quota 
    349354            action = self.warnUserPQuota(userpquota) 
     355             
     356            # if no data to pass to real backend, probably a filter 
     357            # higher in the chain failed because of a misconfiguration. 
     358            # we deny the job in this case (nothing to print anyway) 
     359            if not self.jobSizeBytes : 
     360                self.logger.log_message(_("Job contains no data. Printing is denied."), "warn") 
     361                action = "DENY" 
    350362             
    351363            # exports some new environment variables 
  • pykota/trunk/bin/waitprinter.sh

    r1516 r1519  
    2424# the printer would effectively never print again if the previous job 
    2525# was already fully printed. 
    26 if [ x$PYKOTAACTION != "xDENY" ] && [ x$PYKOTAPHASE == "xAFTER" ] && [ x$PYKOTAJOBSIZEBYTES != "x0" ] ; then 
     26if [ x$PYKOTAACTION != "xDENY" ] && [ x$PYKOTAPHASE == "xAFTER" ] ; then 
    2727  until snmpget -v1 -c public -Ov $1 HOST-RESOURCES-MIB::hrPrinterStatus.1 | grep -i printing >/dev/null; do 
    2828   sleep 1 ; 
  • pykota/trunk/NEWS

    r1517 r1519  
    3434           
    3535        - New PYKOTAJOBSIZEBYTES environment variable exported,   
    36           which contains the job's size in bytes. 
     36          which contains the job's size in bytes. Empty jobs 
     37          are now denied. 
    3738           
    3839    - 1.19alpha16 :