Show
Ignore:
Timestamp:
02/13/05 23:02:29 (19 years ago)
Author:
jalet
Message:

Big database structure changes. Upgrade script is now included as well as
the new LDAP schema.
Introduction of the -o | --overcharge command line option to edpykota.
The output of repykota is more complete, but doesn't fit in 80 columns anymore.
Introduction of the new 'maxdenybanners' directive.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r2008 r2054  
    2222# 
    2323# $Log$ 
     24# Revision 1.149  2005/02/13 22:02:29  jalet 
     25# Big database structure changes. Upgrade script is now included as well as 
     26# the new LDAP schema. 
     27# Introduction of the -o | --overcharge command line option to edpykota. 
     28# The output of repykota is more complete, but doesn't fit in 80 columns anymore. 
     29# Introduction of the new 'maxdenybanners' directive. 
     30# 
    2431# Revision 1.148  2005/01/06 23:24:21  jalet 
    2532# Regain priviledge the time to open the job's data file when printing in 
     
    10121019                return action         
    10131020            else :     
    1014                 val = float(user.AccountBalance or 0.0) 
    1015                 enforcement = self.config.getPrinterEnforcement(printer.Name) 
    1016                 if enforcement == "STRICT" :  
    1017                     val -= self.softwareJobPrice # use precomputed size. 
    1018                 if val <= 0.0 : 
    1019                     action = "DENY" 
    1020                 elif val <= self.config.getPoorMan() :     
    1021                     action = "WARN" 
     1021                if user.OverCharge == 0.0 : 
     1022                    self.printInfo(_("User %s will not be charged for printing.") % user.Name) 
     1023                    action = "ALLOW" 
    10221024                else : 
    1023                     action = "ALLOW" 
    1024                 if (enforcement == "STRICT") and (val == 0.0) : 
    1025                     action = "WARN" # we can still print until account is 0 
     1025                    val = float(user.AccountBalance or 0.0) 
     1026                    enforcement = self.config.getPrinterEnforcement(printer.Name) 
     1027                    if enforcement == "STRICT" :  
     1028                        val -= self.softwareJobPrice # use precomputed size. 
     1029                    if val <= 0.0 : 
     1030                        action = "DENY" 
     1031                    elif val <= self.config.getPoorMan() :     
     1032                        action = "WARN" 
     1033                    else : 
     1034                        action = "ALLOW" 
     1035                    if (enforcement == "STRICT") and (val == 0.0) : 
     1036                        action = "WARN" # we can still print until account is 0 
    10261037                return action     
    10271038        else : 
     
    11061117        if action.startswith("POLICY_") : 
    11071118            action = action[7:] 
     1119             
    11081120        if action == "DENY" : 
    11091121            adminmessage = _("Print Quota exceeded for user %s on printer %s") % (user.Name, printer.Name) 
     
    12861298    def exportUserInfo(self, userpquota) : 
    12871299        """Exports user information to the environment.""" 
     1300        os.environ["PYKOTAOVERCHARGE"] = str(userpquota.User.OverCharge) 
    12881301        os.environ["PYKOTALIMITBY"] = str(userpquota.User.LimitBy) 
    12891302        os.environ["PYKOTABALANCE"] = str(userpquota.User.AccountBalance or 0.0) 
     
    12941307        os.environ["PYKOTAHARDLIMIT"] = str(userpquota.HardLimit) 
    12951308        os.environ["PYKOTADATELIMIT"] = str(userpquota.DateLimit) 
     1309        os.environ["PYKOTAWARNCOUNT"] = str(userpquota.WarnCount) 
    12961310         
    12971311        # not really an user information, but anyway