Changeset 956

Show
Ignore:
Timestamp:
04/24/03 13:53:48 (21 years ago)
Author:
jalet
Message:

Default policy for unknown users/groups is to DENY printing instead
of the previous default to ALLOW printing. This is to solve an accuracy
problem. If you set the policy to ALLOW, jobs printed by in nexistant user
(from PyKota's POV) will be charged to the next user who prints on the
same printer.

Location:
pykota/trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pykota

    r952 r956  
    2323# 
    2424# $Log$ 
     25# Revision 1.25  2003/04/24 11:53:48  jalet 
     26# Default policy for unknown users/groups is to DENY printing instead 
     27# of the previous default to ALLOW printing. This is to solve an accuracy 
     28# problem. If you set the policy to ALLOW, jobs printed by in nexistant user 
     29# (from PyKota's POV) will be charged to the next user who prints on the 
     30# same printer. 
     31# 
    2532# Revision 1.24  2003/04/23 22:13:56  jalet 
    2633# Preliminary support for LPRng added BUT STILL UNTESTED. 
     
    196203            # log a message in any case. 
    197204            policy = kotafilter.config.getPrinterPolicy(kotafilter.printername) 
    198             if policy in [None, "ALLOW"] : 
     205            if policy == "ALLOW" : 
    199206                action = "POLICY_ALLOW" 
    200207            else :     
  • pykota/trunk/conf/pykota.conf.sample

    r952 r956  
    117117# This value can be set either globally or per printer or both. 
    118118# If both are defined, the printer option has priority. 
    119 # If the value is not set then the default policy ALLOW applies. 
    120 policy: allow 
     119# If the value is not set then the default policy DENY applies. 
     120# ATTENTION : 
     121#     Before 1.04pre4 the default value was ALLOW, but unknown users 
     122#     allowed to print causes accuracy problems : their jobs are 
     123#     charged to the next person who prints on the same printer. 
     124policy: deny 
    121125 
  • pykota/trunk/NEWS

    r954 r956  
    2222PyKota NEWS : 
    2323 
     24    - 1.04pre4 : 
     25     
     26        - Default print policy for users/groups unknown from  
     27          the print quota system is now DENY instead of ALLOW, 
     28          since ALLOW can generate inaccurate results 
     29          (incorrect job sizes charged to the wrong persons) 
     30           
    2431    - 1.04pre3 : 
    2532     
  • pykota/trunk/pykota/config.py

    r952 r956  
    2121# 
    2222# $Log$ 
     23# Revision 1.23  2003/04/24 11:53:48  jalet 
     24# Default policy for unknown users/groups is to DENY printing instead 
     25# of the previous default to ALLOW printing. This is to solve an accuracy 
     26# problem. If you set the policy to ALLOW, jobs printed by in nexistant user 
     27# (from PyKota's POV) will be charged to the next user who prints on the 
     28# same printer. 
     29# 
    2330# Revision 1.22  2003/04/23 22:13:57  jalet 
    2431# Preliminary support for LPRng added BUT STILL UNTESTED. 
     
    213220            policy = self.getPrinterOption(printer, "policy").upper() 
    214221        except PyKotaConfigError :     
    215             policy = "ALLOW" 
     222            policy = "DENY" 
    216223        if policy not in validpolicies : 
    217224            raise PyKotaConfigError, _("Option policy in section %s only supports values in %s") % (printer, str(validpolicies)) 
  • pykota/trunk/pykota/tool.py

    r955 r956  
    2121# 
    2222# $Log$ 
     23# Revision 1.38  2003/04/24 11:53:48  jalet 
     24# Default policy for unknown users/groups is to DENY printing instead 
     25# of the previous default to ALLOW printing. This is to solve an accuracy 
     26# problem. If you set the policy to ALLOW, jobs printed by in nexistant user 
     27# (from PyKota's POV) will be charged to the next user who prints on the 
     28# same printer. 
     29# 
    2330# Revision 1.37  2003/04/24 08:08:27  jalet 
    2431# Debug message forgotten 
     
    352359            balance = self.storage.getGroupBalance(groupid) 
    353360            if balance is None : 
    354                 if policy in [None, "ALLOW"] : 
     361                if policy == "ALLOW" : 
    355362                    action = "POLICY_ALLOW" 
    356363                else :     
     
    368375            if quota is None : 
    369376                # Unknown group or printer or combination 
    370                 if policy in [None, "ALLOW"] : 
     377                if policy == "ALLOW" : 
    371378                    action = "POLICY_ALLOW" 
    372379                else :     
     
    427434            balance = self.storage.getUserBalance(userid) 
    428435            if balance is None : 
    429                 if policy in [None, "ALLOW"] : 
     436                if policy == "ALLOW" : 
    430437                    action = "POLICY_ALLOW" 
    431438                else :     
     
    443450            if quota is None : 
    444451                # Unknown user or printer or combination 
    445                 if policy in [None, "ALLOW"] : 
     452                if policy == "ALLOW" : 
    446453                    action = "POLICY_ALLOW" 
    447454                else :     
  • pykota/trunk/pykota/version.py

    r954 r956  
    2121# 
    2222 
    23 __version__ = "1.04pre3-unofficial" 
     23__version__ = "1.04pre4-unofficial" 
    2424 
    2525__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""