Changeset 2803

Show
Ignore:
Timestamp:
03/25/06 22:21:30 (18 years ago)
Author:
jerome
Message:

Changed the behavior of the overwrite_jobticket directive : it's now
impossible to overwrite the username when the job has to be denied
or cancelled (although for cancelled I'm not sure if this is a good
or a bad idea).

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r2797 r2803  
    329329                    username = line.split("=", 1)[1].strip() 
    330330                    self.logdebug("Seen new username [%s]" % username) 
    331                     action = None 
    332331                elif line.startswith("BILLINGCODE=") :     
    333332                    billingcode = line.split("=", 1)[1].strip() 
    334333                    self.logdebug("Seen new billing code [%s]" % billingcode) 
    335                     action = None 
    336334            inputfile.close()     
    337335            self.dropPriv() 
     
    345343                self.Reason = _("Print job cancelled.") 
    346344                os.environ["PYKOTASTATUS"] = "CANCELLED" 
    347             if username : 
    348                 self.UserName = username 
     345            elif username : 
     346                self.UserName = username # If cancelled or denied, we don't allow username to be overwritten 
    349347            # NB : we overwrite the billing code even if empty     
    350348            self.JobBillingCode = billingcode  
  • pykota/trunk/conf/pykota.conf.sample

    r2777 r2803  
    378378#    USERNAME=the_username_we_want_to_overwrite_with 
    379379#    BILLINGCODE=the_billingcode_we_want_to_overwrite_with 
     380#    AUTH=NO (equivalent to DENY below) 
    380381#    DENY  
    381382#    CANCEL 
     
    388389# If only BILLINGCODE= lines are printed, the username is 
    389390# used unchanged. 
    390 # If DENY or CANCEL is output, but is followed by new USERNAME= or 
    391 # BILLINGCODE= lines, the job is not denied nor cancelled. 
     391# If DENY or CANCEL is output, the username can't be overwritten. 
    392392# 
    393393# This value can be set either globally or on a per printer basis