Changeset 1227

Show
Ignore:
Timestamp:
11/29/03 21:06:20 (20 years ago)
Author:
jalet
Message:

Added 'utolower' configuration option to convert all usernames to
lowercase when printing. All database accesses are still and will
remain case sensitive though.

Location:
pykota/trunk
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/conf/pykota.conf.sample

    r1226 r1227  
    134134# If the value is not set then localhost is used. 
    135135smtpserver: localhost 
     136 
     137# Should we force usernames to be all lowercase when printing ? 
     138# Default is No.  
     139# This is a global option only. 
     140# Some people reported that WinXP sends mixed case usernames 
     141# setting 'utolower: Yes' solves the problem. 
     142# Of course you have to user lowercase only when adding 
     143# users with edpykota, because ALL database accesses are 
     144# still case sensitive. 
     145# 
     146# If utolower is Yes, the usernames received from the printing 
     147# system is converted to lowercase at the start of the cupspykota 
     148# backend or of the pykota filter. 
     149# 
     150# If utolower is No, which is the default, strict case checking 
     151# is done, this means that users 'Jerome' and 'jerome' are 
     152# different. Printer and groups names are ALWAYS case sensitive. 
     153utolower: No 
    136154 
    137155# What is the accounting backend to use 
  • pykota/trunk/NEWS

    r1226 r1227  
    2222PyKota NEWS : 
    2323 
     24    - 1.16alpah16 : 
     25     
     26        - Added utolower configuration option to convert all usernames 
     27          to lowercase during printing.  
     28           
    2429    - 1.15alpha15 : 
    2530     
  • pykota/trunk/pykota/config.py

    r1192 r1227  
    2222# 
    2323# $Log$ 
     24# Revision 1.41  2003/11/29 20:06:20  jalet 
     25# Added 'utolower' configuration option to convert all usernames to 
     26# lowercase when printing. All database accesses are still and will 
     27# remain case sensitive though. 
     28# 
    2429# Revision 1.40  2003/11/18 23:43:12  jalet 
    2530# Mailto can be any external command now, as usual. 
     
    197202        self.config = ConfigParser.ConfigParser() 
    198203        self.config.read([self.filename]) 
     204             
     205    def isTrue(self, option) :         
     206        """Returns 1 if option is set to true, else 0.""" 
     207        if (option is not None) and (option.upper().strip() in ['Y', 'YES', '1', 'ON', 'T', 'TRUE']) : 
     208            return 1 
     209        else :     
     210            return 0 
    199211                         
    200212    def getPrinterNames(self) :     
     
    439451    def getDebug(self) :           
    440452        """Returns 1 if debugging is activated, else 0.""" 
    441         debug = self.getGlobalOption("debug", ignore=1) 
    442         if (debug is not None) and (debug.upper().strip() in ['Y', 'YES', '1', 'ON', 'O']) : 
    443             return 1 
    444         else :     
    445             return 0 
     453        return self.isTrue(self.getGlobalOption("debug", ignore=1)) 
    446454             
    447455    def getCaching(self) :           
    448456        """Returns 1 if database caching is enabled, else 0.""" 
    449         caching = self.getGlobalOption("storagecaching", ignore=1) 
    450         if (caching is not None) and (caching.upper().strip() in ['Y', 'YES', '1', 'ON', 'O']) : 
    451             return 1 
    452         else :     
    453             return 0 
     457        return self.isTrue(self.getGlobalOption("storagecaching", ignore=1)) 
    454458             
    455459    def getDisableHistory(self) :           
    456460        """Returns 1 if we want to disable history, else 0.""" 
    457         disablehistory = self.getGlobalOption("disablehistory", ignore=1) 
    458         if (disablehistory is not None) and (disablehistory.upper().strip() in ['Y', 'YES', '1', 'ON', 'O']) : 
    459             return 1 
    460         else :     
    461             return 0 
     461        return self.isTrue(self.getGlobalOption("disablehistory", ignore=1)) 
     462             
     463    def getUserNameToLower(self) :           
     464        """Returns 1 if we want to convert usernames to lowercase when printing, else 0.""" 
     465        return self.isTrue(self.getGlobalOption("utolower", ignore=1)) 
  • pykota/trunk/pykota/tool.py

    r1218 r1227  
    2222# 
    2323# $Log$ 
     24# Revision 1.63  2003/11/29 20:06:20  jalet 
     25# Added 'utolower' configuration option to convert all usernames to 
     26# lowercase when printing. All database accesses are still and will 
     27# remain case sensitive though. 
     28# 
    2429# Revision 1.62  2003/11/25 22:37:22  jalet 
    2530# Small code move 
     
    640645         self.originalbackend) = self.extractInfoFromCupsOrLprng() 
    641646        self.username = self.username or 'root'  
     647        if self.config.getUserNameToLower() : 
     648            self.username = self.username.lower() 
    642649        self.preserveinputfile = self.inputfile  
    643650        self.accounter = accounter.openAccounter(self) 
  • pykota/trunk/pykota/version.py

    r1226 r1227  
    2222# 
    2323 
    24 __version__ = "1.16alpha15_unofficial" 
     24__version__ = "1.16alpha16_unofficial" 
    2525 
    2626__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""