Index: /pykota/trunk/conf/pykota.conf.sample
===================================================================
--- /pykota/trunk/conf/pykota.conf.sample (revision 2965)
+++ /pykota/trunk/conf/pykota.conf.sample (revision 3012)
@@ -897,5 +897,6 @@
 # PYKOTAPHASE : BEFORE or AFTER the job is sent to the printer
 # PYKOTAACTION : ALLOW or DENY or WARN for current print job
-# PYKOTAUSERNAME : user's name
+# PYKOTAUSERNAME : user's name, possibly modified through the overwrite_jobticket directive.
+# PYKOTAORIGINALUSERNAME : user's name, unmodified.
 # PYKOTAPRINTERNAME : printer's name
 # PYKOTAPGROUPS : list of printers groups the current printer is a member of
@@ -925,5 +926,6 @@
 #                   page was still printed on the current printer.                   
 # PYKOTAOVERCHARGE : user's overcharging factor.
-# PYKOTAJOBBILLING : Job's billing code if present (CUPS only)
+# PYKOTAJOBBILLING : Job's billing code if present, possibly modified through the overwrite_jobticket directive.
+# PYKOTAORIGINALJOBBILLING : Job's billing code if present, unmodified.
 # PYKOTAREASON : if the job was denied or a warning needs to be issued, contains
 #                the message to send to the user.
Index: /pykota/trunk/TODO
===================================================================
--- /pykota/trunk/TODO (revision 3011)
+++ /pykota/trunk/TODO (revision 3012)
@@ -1,3 +1,3 @@
-# $Id$
+it's a pyt# $Id$
 
 PyKota - Print Quotas for CUPS and LPRng
@@ -29,8 +29,4 @@
           deleting it.
         
-        - Exports the original username and billing code in two
-          additional environment variables (in case they are
-          overwritten later).
-          
         - Improve the documentation of edpykota's --printer command
           line option.
Index: /pykota/trunk/pykota/version.py
===================================================================
--- /pykota/trunk/pykota/version.py (revision 3007)
+++ /pykota/trunk/pykota/version.py (revision 3012)
@@ -22,5 +22,5 @@
 #
 
-__version__ = "1.25alpha10_unofficial"
+__version__ = "1.25alpha11_unofficial"
 
 __doc__ = "PyKota : a complete Printing Quota Solution for CUPS."
Index: /pykota/trunk/bin/cupspykota
===================================================================
--- /pykota/trunk/bin/cupspykota (revision 3008)
+++ /pykota/trunk/bin/cupspykota (revision 3012)
@@ -279,4 +279,5 @@
         # use CUPS' user when printing test pages from CUPS' web interface
         self.UserName = sys.argv[2].strip() or self.originalUserName or pwd.getpwuid(os.geteuid())[0]
+        self.OriginalUserName = self.UserName[:]
         self.Title = sys.argv[3].strip()
         self.Copies = int(sys.argv[4].strip())
@@ -356,5 +357,9 @@
             jbing = jbing[-1]
         (jbtype, self.JobBillingCode) = jbing
-        
+        if self.JobBillingCode is None :
+            self.OriginalJobBillingCode = None
+        else :    
+            self.OriginalJobBillingCode = self.JobBillingCode[:]
+            
         baselockfilename = self.DeviceURI.replace("/", ".")
         baselockfilename = baselockfilename.replace(":", ".")
@@ -647,4 +652,5 @@
         os.environ["PYKOTAJOBID"] = self.JobId
         os.environ["PYKOTAUSERNAME"] = self.UserName
+        os.environ["PYKOTAORIGINALUSERNAME"] = self.OriginalUserName
         os.environ["PYKOTATITLE"] = self.Title
         os.environ["PYKOTACOPIES"] = str(self.Copies)
@@ -652,4 +658,5 @@
         os.environ["PYKOTAFILENAME"] = self.InputFile or ""
         os.environ["PYKOTAJOBBILLING"] = self.JobBillingCode or ""
+        os.environ["PYKOTAORIGINALJOBBILLING"] = self.OriginalJobBillingCode or ""
         os.environ["PYKOTACONTROLFILE"] = self.ControlFile
         os.environ["PYKOTAPRINTERHOSTNAME"] = self.PrinterHostName
Index: /pykota/trunk/NEWS
===================================================================
--- /pykota/trunk/NEWS (revision 3008)
+++ /pykota/trunk/NEWS (revision 3012)
@@ -22,4 +22,12 @@
 PyKota NEWS :
        
+    - 1.25alpha11 (2006-09-06) :
+    
+        - Now fails in an helpful manner if python-mysqldb is too old.
+        
+        - Now exports the original username and billing code (i.e.
+          their values before they are eventually overwritten) in
+          two additionnal environment variables.
+          
     - 1.25alpha10 (2006-09-03) :
     
